ParamQuery grid support forum
General Category => Help for ParamQuery Pro => Topic started by: kjvjung on November 18, 2017, 11:42:55 am
-
Hello.
Disability scene video: https://youtu.be/2JKXy5o5lWk
I am trying to change the sort field.
It works well on your site.
url: https://paramquery.com/pro/demos24/sorting_remote (good change)
console:
var $grid = $("#grid_sorting_remote");
var DM = $grid.pqGrid("option", "dataModel");
DM.sortIndx = ["OrderDate"];
DM.sortDir = ["up"];
$grid.pqGrid("option", "dataModel", DM);
$grid.pqGrid("refreshDataAndView");
However, there is no change in my site at all.
url: http://php.speedmis.com/_mis/ttt.htm
console:
var $grid = $("#grid_filter");
var DM = $grid.pqGrid("option", "dataModel");
DM.sortIndx = ["MenuName"];
DM.sortDir = ["up"];
$grid.pqGrid("option", "dataModel", DM);
$grid.pqGrid("refreshDataAndView");
The source is very simple.
Why does not it change?
-
Resolved.
We defined the SM as below and put it in pq_sort.
thank you.
postData: function (ui) {
....
var $grid = $("#grid_filter")
var SM = $grid.pqGrid("option", "sortModel");
return {
speed_toobar_filter: "{\"mode\":\"OR\",\"data\":" + JSON.stringify(speed_toobar_filter) + "}",
pq_curpage: pqIS.requestPage,
pq_rpp: pqIS.rpp,
pq_sort: JSON.stringify(SM.sorter),
addLogic: addLogicCatch
};