ParamQuery grid support forum
General Category => Help for ParamQuery Pro => Topic started by: msdnweixiao on November 06, 2020, 12:17:09 pm
-
in the gird init method, i used pageModel like this:
pageModel:{type:"remote", curPage:1, totalPages:1, rPP:1000, rPPOptions:[1000,5000,10000]}
and don't set data.
but totalPages display NaN, what should i do ?
var Grid1_obj = {
height:'100%-70',
showTitle:false,
stripeRows:true,
collapsible:{on:false,toggle:false},
showTop:true,
showBottom:true,
sortable:true,
selectionModel:{type: 'cell', mode: 'block'},
scrollModel:{autoFit: false},
virtualX:true,
virtualY:true,
groupModel:Grid1_cols.groupModel,
contextMenu: {
on: true,
cellItems: Grid1_bodyItems},
sortModel: {
type: 'remote',
single: true,
space: true,
multiKey: null
},
rowInit:function( ui ){
var rowData = ui.rowData;
var fcolor = rowData.FCOLOR;
if (!fcolor) {
fcolor = rowData.fcolor;
}
if (fcolor) {
return { cls: fcolor};}
},
resizable:false,
wrap:false,
hwrap:false,
numberCell:{show: true, resizable: true, title: "#"},
colModel:Grid1_cols.pqCols,
pageModel:{type:"remote", curPage:1, totalPages:1, rPP:1000, rPPOptions:[1000,5000,10000,50000]},
rowBorders:true
};
$('#Grid1_GRID').pqGrid(Grid1_obj);
-
Please set dataModel.
https://paramquery.com/pro/demos/paging
-
i add dataModel like this:
var Grid1_dataModel = {
location: 'local',
data: []
};
var Grid1_obj = {
.........
dataModel:Grid1_dataModel,
pageModel:{type:"remote", curPage:1, totalPages:1, rPP:1000, rPPOptions:[1000,5000,10000,50000]},
};
$('#Grid1_GRID').pqGrid(Grid1_obj);
but totalPages still display NaN, why?
-
You can't use local data with remote paging.
What exactly is your goal. Do you want to set up local or remote paging?
pageModel.type = "remote" and dataModel.location = "remote" are used if you have implemented remote paging on the server side.
Remote paging example is here: https://paramquery.com/pro/demos/paging
If you haven't implemented server side paging, then set pageModel.type = "local"
-
yeah, set dataModel.location = "remote", totalPages display 1, that's perfect. thank you .