-
Notifications
You must be signed in to change notification settings - Fork 0
/
36sortrows.html
44 lines (44 loc) · 1.46 KB
/
36sortrows.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<div style="font-size:12px;">
Another very usefull addition in grid.jqueryui.js module is adding a possibility for sortable rows.<br>
In order to use this feature a jQuery UI sortable widget is used.<br/>
Try to sort the rows in the grid<br>
Note that all available options and evenents from sortable widget can be used <br>
<br />
<table id="sortrows"></table>
<div id="psortrows"></div>
<script src="36sortrows.js" type="text/javascript"> </script>
<br />
<div style="font-size:12px;">
<b> HTML </b>
<XMP>
<table id="sortrows"></table>
<div id="psortrows"></div>
</XMP>
<b>Java Scrpt code</b>
<XMP>
jQuery("#sortrows").jqGrid({
url:'server.php?q=2',
datatype: "json",
colNames:['Inv No','Date', 'Client', 'Amount','Tax','Total','Notes'],
colModel:[
{name:'id',index:'id', width:55},
{name:'invdate',index:'invdate', width:90},
{name:'name',index:'name asc, invdate', width:100},
{name:'amount',index:'amount', width:80, align:"right"},
{name:'tax',index:'tax', width:80, align:"right"},
{name:'total',index:'total', width:80,align:"right"},
{name:'note',index:'note', width:150, sortable:false}
],
rowNum:10,
width:700,
rowList:[10,20,30],
pager: '#psortrows',
sortname: 'invdate',
viewrecords: true,
sortorder: "desc",
caption:"Sortable Rows Example"
});
jQuery("#sortrows").jqGrid('navGrid','#psortrows',{edit:false,add:false,del:false});
jQuery("#sortrows").jqGrid('sortableRows');
</XMP>
</div>