0
我想對鍵值對中有數據的列進行排序。目前我已經實現了使用基於關鍵字Id的自定義排序功能進行排序。在這裏,我想根據不是Id的值進行排序。我怎樣才能做到這一點?任何人都可以幫我解決這個問題嗎?使用jqgrid按列值排序
請查看以下代碼供您參考。
jQuery("#list2").jqGrid({
url: '/LocaleRate/LocaleRates',
mtype: 'GET',
datatype: "json",
colModel: [
{ name: 'ID', hidden: true },
{
name: 'SourceLocaleId', index: 'SourceLocaleId', edittype: "select", formatter: 'select',
editoptions: { value: newLocalelist },
sorttype: function (value, rowObject) {
return rowObject.SourceLocaleId;
},
},
{
name: 'LocaleId', index: 'LocaleId', edittype: "select", formatter: 'select', editoptions: { value: newLocalelist },
sorttype: function (value, rowObject) {
return rowObject.LocaleId;
},
}] )}