ParamQuery grid support forum

General Category => Help for ParamQuery Pro => Topic started by: ncpowerbrute66 on November 12, 2015, 08:14:03 pm

Title: multiple grids same column model different dataModels issue
Post by: ncpowerbrute66 on November 12, 2015, 08:14:03 pm
I am trying to run 2 grids on the same page which uses the same column model but different data models.  If the data models are blank everything works and if I use the same data model for both it works but, when I populate the second grid with a different data model it does not show the updated results or worse throws an error code "Unhandled exception at line 135, column 160 in pqgrid.js.  Can pqgrid use independent data models on the same page and if so is there an example?
 
Title: Re: multiple grids same column model different dataModels issue
Post by: paramvir on November 12, 2015, 08:28:56 pm
colModel should be deep cloned if you intend to reuse it in more than one grid. The same applies for dataModel or any other nested option.

For example the colModel is deep cloned with help of jQuery extend() method in below demo:

http://paramquery.com/pro/demos/scroll
Title: Re: multiple grids same column model different dataModels issue
Post by: ncpowerbrute66 on November 23, 2015, 07:02:36 pm
Thanks for the response.  This issue was tracked down to be unrelated to PQGrid.  I was switching data models and db connections in the controller that was returning  values back to pqgrid.