I have a JQGrid which has add/edit form functionality enabled. Both are working fine. I’m extending the Edit functionality.
I’m adding a custom element to edit form. custom element is ANCHOR TAG with click event defined
-
on click of ANCHOR TAG, I’m doing an ajax call to server and updating some values. until here it is working fine.
-
on successful return, I want reload the edit form with new values.
My Approach
On successful return,
- I reload the grid (working fine) —
$('#grid').jqGrid().trigger("reloadGrid"); - Close the edit form (working fine) —
$('#grid').find('.ui-jqdialog-titlebar-close').click(); - reopen the edit form (not working). It opens the same edit form with old values. If I open it manually by clicking edit icon, it refreshes the values. —
$('#grid').jqGrid('editGridRow', gr, {Edit params})
Question
Can some one find what why my step 3 not working? And also please let me know if any one have better approach?
I solved this issue by:
close existing JQGrid edit form
set selected row first
then trigger editGridRow event