Author Topic: RefreshDataAndView of detail model without collapse  (Read 2924 times)

ksikes

  • Newbie
  • *
  • Posts: 1
    • View Profile
RefreshDataAndView of detail model without collapse
« on: September 20, 2016, 02:09:50 am »
Following the Nested Grid demo for ParamQuery Pro I setup three levels of grids in the hierarchy of Departments, Categories, and Courses.  An on change event at the courses level refreshes data at the Departments level, but I find that I cannot refresh the view of the data in the nested grid, Categories programatically.  I find that if I collapse the Categories grid and expand it again, the underlying data is refreshed and renders properly.

I am calling "refreshDataAndView" at the top level grid, i.e. $("#grid_Department").pqGrid("refreshDataAndView");
I expected the call to refresh would trickle down through the nested grid(s) but it does not seem to do so.

Wondering if there is a way to call the refresh directly to the nested grid but I am unable to determine the proper selector to use.
Is there  a built in method to programatically force the refresh of a nested grid?  If not, can we programatically collapse and expand a nested grid to force the refresh?

Thanks in advance for any insight you can provide.


paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6282
    • View Profile
Re: RefreshDataAndView of detail model without collapse
« Reply #1 on: September 20, 2016, 09:24:43 pm »
Reference to detail grid is stored in corresponding parent row as.

Code: [Select]
  var child = rowData.pq_detail.child.pqgrid( 'instance' );

  child.refresh();  //refresh the nested grid.


There is a similar question here: http://paramquery.com/forum/index.php?topic=1540
« Last Edit: September 20, 2016, 09:29:22 pm by paramquery »

TonyLeech

  • Pro Enterprise
  • Jr. Member
  • *
  • Posts: 76
    • View Profile
Re: RefreshDataAndView of detail model without collapse
« Reply #2 on: November 26, 2016, 02:53:03 am »
For anyone who does what I did and copy and paste the reply code sample above, please be aware of the small typo pqgrid should read pqGrid (note upper case G).

var child = rowData.pq_detail.child.pqGrid( 'instance' );