I have some problem with local data sorting in this example. Sorting doesn't work and I don't know reason of it. Could you explain problem in my code?
<table id="list" ></table>
<div id="pager"></div>
<script type="text/javascript">
var myData = [
{ id: "1", cell: ["1", "test"] },
{ id: "2", cell: ["2", "test2"] },
{ id: "3", cell: ["3", "test3"] },
{ id: "4", cell: ["4", "test4"] }
];
jQuery("#list").jqGrid({
data: myData,
datatype: "local",
colNames: ['MyId','Client'],
colModel: [{ name: 'MyId', index: 'MyId', width: 100, align: 'left' , sortable: true},
{ name: 'Client', index: 'Client', width: 100, align: 'left', sortable: true }],
rowNum:10,
rowList:[10,20,30,100],
pager: '#pager',
sortname: 'Id',
localReader: {repeatitems: true},
viewrecords: true,
sortable: true,
sortorder: "asc",
caption: "Tests",
loadonce: true
});
jQuery("#list").jqGrid('navGrid', '#pager', { edit: false, add: false, del: false });
</script>
P.S. Sorting also doesn't work in this demo with local data. http://www.ok-soft-gmbh.com/jqGrid/LocalReader.htm