Author Topic: multiple grids same column model different dataModels issue  (Read 2736 times)

ncpowerbrute66

  • Pro Deluxe
  • Newbie
  • *
  • Posts: 8
    • View Profile
multiple grids same column model different dataModels issue
« 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?
 

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6263
    • View Profile
Re: multiple grids same column model different dataModels issue
« Reply #1 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
« Last Edit: November 13, 2015, 02:22:15 am by paramquery »

ncpowerbrute66

  • Pro Deluxe
  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: multiple grids same column model different dataModels issue
« Reply #2 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.