Reload parent grid after delete row in child grid

QuestionsReload parent grid after delete row in child grid
anavarro asked 11 years ago

Hi.

I need to reload the parent grid after I erase a row in a child grid.

I already reload the parent grid after I insert a row in a child with this line of code:

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

I place that code before the set_options($opt) on the detail grid, but looks like it doesn't work for deletion.

5 Answers
Abu Ghufran answered 11 years ago

Just replace add_options with delete_options.

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

anavarro answered 11 years ago

It works now, it reloads the parent grid after deletion but the dialog that ask for delete confirmation doesn't hide.

Thanks.

Abu Ghufran answered 11 years ago

Change return true; with return [true, ''];

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

anavarro answered 11 years ago

It works now as intended.

Thanks for your help, Abu.

Frederik answered 10 years ago

Hello, i'm using master-sub grid, i want to reload the entire parent grid after the delete event on a subgrid row.

Currently after the delete event the subgrid is reloaded but not the parent-master grid.

I tried to add this line in the subgrid code without success:

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

The id of the master grid is #list1.

Can you help me? Thanks

Your Answer

19 + 3 =

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?