1
我是初學者... 我正在用JQuery使用劍道網格。如何獲得劍道網格中的當前排序字段?
我想獲得kendo-gird當前的排序字段。
我發現了這個。 console.log(grid.dataSource._sort [0] .dir); console.log(grid.dataSource._sort [0] .field);
我可以找到替代方法嗎?
這是我的代碼。
var dataSource = new kendo.data.DataSource({
transport : {
read : {
type : 'post',
dataType : 'json',
contentType : 'application/json;charset=UTF-8',
url : cst.contextPath() + "/watcher/kendoPagination_statsErrorHistoryRetrieveQry.htm",
data : param
},
parameterMap: function (data, opperation) {
return JSON.stringify(data);
}
},
schema : {
data : function(data) {
return data;
},
total : function(response) {
return response.length > 0 ? response[0].TOTAL_COUNT : 0;
}
},
pageSize : cst.countPerPage(),
serverPaging : true,
serverSorting : true
});
var columns = kendoGridColumns();
$("#grid")
.kendoGrid({
dataSource : dataSource,
sortable : {
mode : 'multiple',
allowUnsort : true
},
columns : columns.error()
selectable : 'row',
scrollable : true,
resizable : true,
}));
如何獲取當前排序的字段名?