-
Notifications
You must be signed in to change notification settings - Fork 0
/
40cmtmpl.html
49 lines (49 loc) · 1.48 KB
/
40cmtmpl.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
45
46
47
48
49
<div style="font-size:12px;">
It is possible to define default options for all columns when they are created.<br/>
In the example we demonstrate how all fields can not be sortable.<br/>
By default all fields are sortable.
</div>
<br />
<table id="cmtmpl"></table>
<div id="pcmtmpl"></div>
<script src="40cmtmpl.js" type="text/javascript"> </script>
<br />
<div style="font-size:12px;">
<b> HTML </b>
<XMP>
<table id="cmtmpl"></table>
<div id="pcmtmpl"></div>
</XMP>
<b>Java Scrpt code</b>
<XMP>
jQuery("#cmtmpl").jqGrid({
url:'server.php?q=4',
datatype: "json",
colNames:['Inv No', 'Date', 'Client', 'Amount','Tax','Total','Notes'],
colModel:[
{name:'id', key : true, index:'id', width:55},
{name:'invdate',index:'invdate', width:90},
{name:'name', index:'name', 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}
],
// define a model where all fields are not sortable,
// this setting overwrite the deafult one for all fields
cmTemplate: {sortable:false},
rowNum:10,
width:700,
rowList:[10,20,30],
pager: '#pcmtmpl',
sortname: 'invdate',
viewrecords: true,
sortorder: "desc",
jsonReader: {
repeatitems : false
},
caption: "Column model templates",
height: '100%'
});
jQuery("#cmtmpl").jqGrid('navGrid','#pcmtmpl',{edit:false,add:false,del:false});
</XMP>