이 예제에서는 로컬 데이터 정렬에 약간의 문제가 있습니다. 정렬이 작동하지 않으며 그 이유를 알지 못합니다. 내 코드에서 문제를 설명해 주시겠습니까?JqGrid : 로컬 데이터 정렬
<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. 이 데모에서는 로컬 데이터를 사용한 정렬 기능도 작동하지 않습니다. http://www.ok-soft-gmbh.com/jqGrid/LocalReader.htm
"작동하지 않음"이란 무엇을 의미합니까? 좀 더 구체적 일 수 있습니까? – Robert
"작동하지 않음"은 jqgrid 정렬을 사용하여 표에서 값을 정렬 할 수 없음을 의미합니다. 데모 [link] (http://www.ok-soft-gmbh.com/jqGrid/LocalReader.htm)에서 'client'열의 머리글을 클릭하면 정렬을 통해 요소의 순서가 변경되지 않습니다. – Aracturat
그리고 정렬은 jqgrid 로컬 정렬을 의미합니다. – Aracturat