Master Detail Refresh on Save

QuestionsMaster Detail Refresh on Save
Abed asked 9 years ago

Hello Abu,

I have a master and detail form and trying to refresh the master grid when making changes on detail. I used the following setting:

$grid["onAfterSave"] = "function(){ jQuery('#list1').trigger('reloadGrid',[{jqgrid_page:1}]); }";
$grid["add_options"]["afterSubmit"] = "function(){jQuery('#list1').trigger('reloadGrid',[{jqgrid_page:1}]); return [true, ''];}";
$grid["edit_options"]["afterSubmit"] = "function(){jQuery('#list1').trigger('reloadGrid',[{jqgrid_page:1}]); return [true, ''];}";
$grid["delete_options"]["afterSubmit"] = "function(){jQuery('#list1').trigger('reloadGrid',[{jqgrid_page:1}]); return [true, ''];}";

I can refresh master grid when deleting and inserting new rows to detail grid and everything works fine. The only problem is that the master does not refresh when I click on save button on the action menu in the button of sub grid. (The refresh works when I hit enter in the rows after editing and also it works when using edit dialog). I guess the jquery code for refreshing is not assigned to the save button on the action menu on the bottom bar of the grid. I appreciate if you help.

3 Answers
Abu Ghufran answered 9 years ago

Emailed you updated lib and working demo.

Patricia Lawson answered 9 years ago

Can we all get the solution to this problem? I want to refresh values in the Master grid after deleting a row in the detail grid.
Thanks

Abu Ghufran answered 9 years ago

Following code should work.

$grid["delete_options"]["afterSubmit"] = "function(){jQuery('#list1').trigger('reloadGrid',[{jqgrid_page:1}]); return [true, ''];}";
$g->set_options($grid);

Where, $g is detail grid object, and list1 is master grid id.

Your Answer

11 + 14 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?