jqGrid 多 table 列排序
jqGrid multiple table columns sorting
在 JqGrid 中,我启用了多重排序选项,在网格视图中 table 我正在从两个具有外键关系的 table 中获取列。数据在视图中正确显示,但当我使用标记 table 列排序时,它显示空白详细信息。
只有学生 table 列正在排序。 Marks table 中的列没有排序,它给出了空白的详细信息。
url:'<?php echo $config['ajaxUrlPath'];?>json.php',
datatype: "json",
mtype: 'POST',
height : 'auto',
colNames : ['Student Name', 'Email','10th %','12th %'],
colModel : [{name : 'name',index : 'name',width:100},
{name : 'email',index: 'email',width:100},
{name : 'tenthperc',index : 'tenthperc',width:100},
{name : 'twelthperc',index : 'twelthperc',width:100},
],
rowNum : 10,
rowList : [10,20,30,50,100],
pager : '#pjqgrid',
sortname : 'id',
viewsortcols : [true,'vertical',true],
toolbarfilter : true,
viewrecords : true,
sortorder : "asc",
您似乎没有使用 loadonce: true
选项。所以排序是在您的服务器代码中实现的。您应该准确检查 sidx
和 sord
值,它们在多排序情况下将 jqGrid 发送到服务器。我想您当前的服务器代码只使用了 sidx
的第一部分,这就是您遇到问题的原因。
在 JqGrid 中,我启用了多重排序选项,在网格视图中 table 我正在从两个具有外键关系的 table 中获取列。数据在视图中正确显示,但当我使用标记 table 列排序时,它显示空白详细信息。
只有学生 table 列正在排序。 Marks table 中的列没有排序,它给出了空白的详细信息。
url:'<?php echo $config['ajaxUrlPath'];?>json.php',
datatype: "json",
mtype: 'POST',
height : 'auto',
colNames : ['Student Name', 'Email','10th %','12th %'],
colModel : [{name : 'name',index : 'name',width:100},
{name : 'email',index: 'email',width:100},
{name : 'tenthperc',index : 'tenthperc',width:100},
{name : 'twelthperc',index : 'twelthperc',width:100},
],
rowNum : 10,
rowList : [10,20,30,50,100],
pager : '#pjqgrid',
sortname : 'id',
viewsortcols : [true,'vertical',true],
toolbarfilter : true,
viewrecords : true,
sortorder : "asc",
您似乎没有使用 loadonce: true
选项。所以排序是在您的服务器代码中实现的。您应该准确检查 sidx
和 sord
值,它们在多排序情况下将 jqGrid 发送到服务器。我想您当前的服务器代码只使用了 sidx
的第一部分,这就是您遇到问题的原因。