Author Topic: How to return last selected row after detail edit in nesting with lazy loading?  (Read 2034 times)

mewbie

  • Pro Deluxe
  • Newbie
  • *
  • Posts: 33
    • View Profile
Hello,

I built a master/detail grid based on nesting with lazy loading example and add 'Edit' button at the grid header based on https://paramquery.com/demos/crud intended to edit them at once for both master and adding row at detail grid.

I have to use
Code: [Select]
pqGrid("refreshDataAndView") so detail grid showing the latest inputed data, but the problem is on the row selection (of the master grid) getting back to the initial state (no row is selected).

How can user see their input after submit and row selection focusing to the latest edited master grid? If using
Code: [Select]
pqGrid("refresh") Data in the detail grid is not called.

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
I'm not sure why call to refreshDataAndView() for detail grid causes lose of selection in main grid until you show me a sample/ jsfiddle.

Anyway, there is no need to call refreshDataAndView() on detail grid or any grid to show changes made by the user. it's also not recommended.

you could use commit API to show the changes as demonstrated in the editing examples.

https://paramquery.com/pro/demos/editing_batch

mewbie

  • Pro Deluxe
  • Newbie
  • *
  • Posts: 33
    • View Profile
I need to do it one at a time with pop up editing/adding window and then the result will be shown in the nested row (hence the selection marker), finally I just mark it with alert window of the latest edited data, not the most elegant way.

I might do your suggestion in the future, though.