我有一个 jqgrid,我有一个 SortNo 字段来处理我的排序,当我在 sortNo 中添加相同的数字并按顺序自动调整数字时,如何动态调整其排序。请参阅上面链接中的示例。有人可以帮帮我吗?
$(document).ready(function(){
var xaxis=645
var yaxis = $(document).height();
yaxis = yaxis-100;
getGrids();
$("#maingrid").jqGrid({
url:'models/gridheaders.php?todo=select&id=new',
datatype: 'xml',
mtype: 'POST',
colNames:['ID','Description_EN','Description_JP',
'SortNo','ColWidth','GridID','Module'],
colModel :[
{name:'id', index:'id', width:120, align:'center',sortable:false,editable:false,editoptions:{size:"30",maxlength:"30"}},
{name:'eng', index:'eng', width:120, align:'center',sortable:false,editable:true,edittype:"text",editoptions:{size:"30",maxlength:"30"}},
{name:'jap', index:'jap', width:120, align:'center',sortable:false,editable:true,edittype:"text",editoptions:{size:"30",maxlength:"30"}},
//This field is I want to dynamically sort.
{name:'sort', index:'sort', width:120, align:'center',sortable:false,editable:true,edittype:"text",editoptions:{size:"30",maxlength:"30"}},
{name:'col', index:'col', width:120, align:'center',sortable:false,editable:true,
edittype:"text",editoptions:{size:"30",maxlength:"30"}},
{name:'grid', index:'grid', width:120, align:'center',sortable:false,editable:true,hidden:true,edittype:"text",
editoptions:{size:"30",maxlength:"30"},editrules: { edithidden: true}},
{name:'used', index:'used', width:120, align:'center',sortable:false,editable:true,hidden:true,edittype:"text",editoptions:{size:"30",maxlength:"30"},editrules: { edithidden: true}},
},
],
viewrecords: true,
rowNum: -1,
height: yaxis,
width: xaxis,
shrinkToFit: false,
multiselect: true,
editurl:""
});
有人可以帮助我,我应该使用什么功能来进行动态排序?谢谢