ParamQuery grid support forum
General Category => Help for ParamQuery Pro => Topic started by: Jignesh on December 18, 2019, 12:22:36 pm
-
Hi Paramvir,
Project file is bigger so I have sent attachment by wetransfer and sent mail by cherish.patel@convergesolution.com.
I have sent demo zip file for PQGrid Page by “Wetransfer”.
PQGrid demo Path Like: “/Test/Index”
Description: I have set 2 buttons for “Gird1” and “Grid2”.
When Grid1 button click then Page refresh and set 4 columns with data.
When Grid2 button click then Page refresh and set 3 columns with data.
Issue: How can I change columns in same page and same gird without page refresh ?
Please give me some solution for same and let me know if any query for demo project.
Thank you,
Cherish Patel
-
It's simply a matter of switching colModel
In click handler of first button.
grid.refreshCM( colModel1 );
grid.refresh();
And in click handler of 2nd button.
grid.refreshCM( colModel2 );
grid.refresh();
https://paramquery.com/pro/api#option-colModel
https://paramquery.com/pro/api#method-refreshCM
-
Hi Paramvir,
I have put below code after save grid but data not refreshed after success.
grid.refreshCM( colModel1 );
grid.refresh();
I have also tried below code for data refresh:
data = JSON.parse(jsonData);
obj.dataModel = { data: data };
grid.pqGrid(obj); (get error like .pdGrid is not function)
then after I tried below code which use same in first time grid bind.
grid = pq.grid("#dndgrid", obj);
pq.grid('refreshDataAndView', obj);
but error occurred. And data not refreshed .
Please help me on this.
Thank you,
Jignesh
-
Previous reply was for resetting new colModel in grid.
To reset new data in grid, please use this:
//setter
grid.option( "dataModel.data", dataSales );
//setter of dataModel.data is followed by refreshDataAndView method call.
grid.refreshDataAndView()
https://paramquery.com/pro/api#option-dataModel-data