PageRenderTime 282ms CodeModel.GetById 266ms app.highlight 13ms RepoModel.GetById 1ms app.codeStats 0ms

/www/js/magic_app.js

http://cupsfilter.googlecode.com/
JavaScript | 88 lines | 80 code | 6 blank | 2 comment | 0 complexity | 6b8268ae426b75747c86bd8b6993d347 MD5 | raw file
 1jQuery(document).ready(function(){
 2	var printersel='create_sel.php?field=printer';
 3        var markersel='create_sel.php?field=marker';
 4        var cups_sel='create_sel.php?field=cupsuser';
 5        var executorsel='create_sel.php?field=executor';
 6        var pressmansel='create_sel.php?field=pressman';
 7         
 8        jQuery("#tblcontents").jqGrid({
 9	url:'getdata.php',
10	datatype: 'json',
11	mtype: 'POST',
12	height: 200,
13        datatype: 'local', 
14	colNames:['#','????','???????','????','???????? ?????????','? ??','???. ?????','?????','? ?????','???-?? ???.','???-?? ?????','CupsUser','???????????','?????????','?????? ???-??','??????????'], 
15	colModel:[  
16		{name:'id',index:'id', search:false, editable:false, width:35},  
17		{name:'datetime',index:'datetime', formatter:'date',formatoptions:{srcformat: 'Y-m-d',newformat: 'd.m.Y'},width:80, align:'right'},  
18		{name:'printer_name',index:'printer_name',search:true,edittype:'select',surl:printersel, width:90},  
19		{name:'docmarker',index:'docmarker', edittype:'select',surl:markersel,width:90, align:'right'},  
20		{name:'docname',index:'docname', width:250,align:'center',sortable:false},  
21		{name:'mb_number',index:'mb_number', width:90, align:'right'},  
22		{name:'inv_number',index:'inv_number', width:90, align:'right'},  
23		{name:'punkt',index:'punkt', width:90, align:'right'},  
24		{name:'copynumber',index:'copynamber', width:80, align:'right'},  
25		{name:'pagecount',index:'pagecount', width:80, align:'right'},  
26		{name:'pagecopy',index:'pagecopy', width:80, align:'right'},  
27		{name:'cupsuser',index:'cupsuser',edittype:'select',surl:cups_sel, width:80, sortable:false}, 
28		{name:'executor_fio',index:'executor_fio',edittype:'select',surl:executorsel,width:150, sortable:false},
29		{name:'pressman_fio',index:'pressman_fio',edittype:'select',surl:pressmansel,width:150, sortable:false}, 
30		{name:'status',index:'status', search:false,width:100, align:'right'},  
31		{name:'infostr',index:'infostr',search:false, width:180, sortable:false}
32	], 
33	rowNum:10, 
34	rowList:[10,20,30,50], 
35	pager: jQuery('#tblcontentsPager'), 
36	sortname: 'id', 
37	viewrecords: true, 
38        imgpath: 'themes/basic/images',
39        caption: '????????? ?????? ??????? ?????????? ??????',
40	sortorder: "asc",
41	subGrid: true, 
42	subGridRowExpanded: function(subgrid_id, row_id) { 
43	    // we pass two parameters, subgrid_id is a id of the div tag created within a table, the row_id is the id of the row 
44	    // If we want to pass additional parameters to the url we can use the method getRowData(row_id) - which returns associative array in type name-value here we can easy construct the following 
45	    var subgrid_table_id; 
46	      subgrid_table_id = subgrid_id+"_t"; 
47	      jQuery("#"+subgrid_id).html("<table id='"+subgrid_table_id+"' class='scroll'></table>"); 
48              
49              jQuery("#"+subgrid_table_id).jqGrid({ 
50	          url:"subgrid.php?id="+row_id, 
51        	  datatype: "json", 
52	          colNames: ['rep_id','list_id','??????????'], 
53	          colModel: [ 
54        		{name:'rep_id',index:'rep_id',width:80,key:true}, 
55	            	{name:'list_id',index:'list_id',width:80}, 
56		        {name:'adress',index:'adress',width:200,align:'right',sortable:false} 
57                        ], 
58          	rowNum:20, 
59        	imgpath: 'themes/basic/images',
60          	sortname: 'rep_id', 
61          	sortorder: "asc" 
62       	     });
63	}
64
65       
66	})
67
68	jQuery("#srccontents").filterGrid("tblcontents",{ 
69        	gridModel:true, 
70	        gridNames:true,   
71                searchButton:"??????",
72                clearButton:"????????",
73        	formtype:"vertical", 
74	        enableSearch: true, 
75        	enableClear: true, 
76	        autosearch: false
77	      }); 
78	jQuery("#tblcontents").setGridParam({datatype:'json'});  
79      	var ts = $('#srccontents')[0];  
80      	ts.triggerSearch();
81	});
82
83$(function() {
84	$('#sg_datetime').datepicker({
85		changeMonth: true,
86		changeYear: true
87	});
88});