ParamQuery grid support forum
General Category => Help for ParamQuery Pro => Topic started by: elearnster on September 18, 2014, 04:26:37 am
-
When I create a dynamic web page, I have 8 data arrays that are predefined and default to the first array. Outside of the PG Grid's $(function () call, I need to re-assign a global variable are reload a different data array. I tried to destroy the Grid but unable to reload the table. Can you suggest a strategy to accomplish this? Thank you in advance. eLearnster
-
$grid can be referenced by $( '.selector' ) outside of the $(function ()) call
different array can be assigned to grid by changing dataModel.data and calling refreshView after that.
-
The approach to change the data modal array makes sense. I initially use arrayData1 and then try to change it to arraryData2.
Here is my syntax inside of the PQ-Grid:
//** Execute the best year worksheet.
var $grid1 = $("#grid_Compute_Stats").pqGrid(obj_Grid1);
Here is my syntax outside of the PQ-Grid:
$Grid1.pqGrid("option", "dataModel", { data: arrayData1 });
$grid1.pqGrid("refreshDataAndView");
However, I am having an "Uncaught reference error: $Grid1 is not defined."
Your help is appreciated.
eLearnster.
-
The reference should be re obtained outside of the $(function(){})
var $grid1 = $("#grid_Compute_Stats");
$grid1.pqGrid("option", "dataModel", { data: arrayData2 });
$grid1.pqGrid("refreshDataAndView");
-
Your approach worked great. I have been using PQ-Grid for a couple of months and the software and support has been outstanding.
eLearnster.