ParamQuery grid support forum
General Category => Help for ParamQuery Pro => Topic started by: omerix on February 12, 2019, 08:09:37 pm
-
Hello,
"colModel" column orders not work. I am using codes below.
saveState Code
grid.saveState();
stateKeys Code
,stateKeys : {columnBorders:1,menuIcon:1,filterModel:['on','menuIcon','gridOptions','mode','header','timeout','type']}
create Code
,create: function(){
this.loadState({refresh: false});
var state = JSON.parse(localStorage.getItem("pq-grid"+this.element[0].id));
if (state!=null) {
this.option('filterModel', state.filterModel);
this.option('menuIcon', state.menuIcon);
this.option('columnBorders', state.columnBorders);
};
}
-
Please restore individual filterModel properties of interest instead of restoring whole filterModel.
create: function () {
//restore state of grid.
this.loadState({ refresh: false });
var state = JSON.parse(localStorage.getItem("pq-grid"+this.element[0].id));
if (state!=null) {
var filterModel = state.filterModel || {};
this.option('filterModel.header', filterModel.header);
this.option('menuIcon', state.menuIcon);
this.option('columnBorders', state.columnBorders);
};
},
-
Hello param,
I'm having trouble with colModel.
I think this happens because of the column merger.
The following figure needs a test.
https://paramquery.com/pro/demos/grid_state
Restoring column width. But the column does not load the order.
No problem with saveState. "Chrome" -> "F12" -> "Application" -> "Local storage" -> "Json" = True
Test Code Please. ({ title: "Shipping",colModel:[..........]})
var colM = [
{ title: "ShipCountry", width: 100, dataIndx: "ShipCountry",
filter: { crules:[{ condition: 'begin'}] }
},
{ title: "Customer Name", width: 120, dataIndx: "ContactName",
filter: { crules:[{ condition: 'begin' }] }
},
{ title: "Order ID", minWidth: 130, dataIndx: "OrderID", dataType: "integer",
filter: { crules:[{ condition: "between" }] }
},
{ title: "Order Date", minWidth: "190", dataIndx: "OrderDate", dataType: "date" },
{ title: "Shipping Region", width: 140, dataIndx: "ShipRegion",
filter: {
crules:[{ condition: 'range' }],
groupIndx: "ShipCountry"
}
},
{ title: "Paid", width: 100, dataIndx: "paid", dataType: "bool", align: "center",
filter: { crules:[{ condition: "equal" }] }
},
{ title: "Shipping Via", width: 130, dataIndx: "ShipVia",
filter: {
crules:[{ condition: 'range' }]
}
},
{ title: "Required Date", width: 100, dataIndx: "RequiredDate", dataType: "date" },
{ title: "Shipped Date", width: 100, dataIndx: "ShippedDate", dataType: "date" },
{ title: "Freight", width: 120, align: "right", dataIndx: "Freight", dataType: "float" },
{ title: "Shipping",colModel:[
{ title: "Name", width: 150, dataIndx: "ShipName" },
{ title: "Address", width: 270, dataIndx: "ShipAddress" },
{ title: "City", width: 100, dataIndx: "ShipCity" },
{ title: "Postal Code", width: 150, dataIndx: "ShipPostalCode" }
]}
];
-
ok you have grouped columns.
Sorry, column order is not restored with loadState in case of grouped columns.
-
Thanks for the answer.
ok you have grouped columns.
Sorry, column order is not restored with loadState in case of grouped columns.