Hello Abu
How can i trigge the update of the master grid when performin a clone action in the subgrid? i have tried with a custom function but i can get it work
function custom_clone($data)
{
function(){jQuery(‘#list2’).trigger(‘reloadGrid’,[{jqgrid_page:1}]); return [true, ”];}
}
have a look at http://support.phpgrid.org/questions/2-grids-on-same-page-refresh-2nd-grid-with-javascript/
Hello Wing
I appreciate your willingness to help. My problem is specifically with the CLONE event that is not triggering the refresh in the master grid. The refresh in the onAfterSave, add_options,edit_options and delete_options Work flawless.
i have the code line
**grid_event** = “function(){jQuery(‘#list2’).trigger(‘reloadGrid’,[{jqgrid_page:1}]); return [true, ”];}”;
in each of these events and none triggers the refresh of the master grid( which is named list2)
regards
I missed this ticket somehow. The library does not have any event like onAfterClone.
We’ll be adding it in todos.
If you need it desperately, you can hack into lib/inc/jqgrid_dist.php and inject your code here:
Hi. Has the clone callback feature been implemented since then? I\’m having a similar issue. When a row is cloned, it\’s not obvious where to find the cloned row. For adding a row, I managed to reload the grid in reverse order. I\’m hoping to do the same with clone. I tried this but didn\’t work. It just reloads the grid with default sort order: success: function( data ) { console.log(\”Success callback triggered.\”); jQuery(\”#\” + grid).jqGrid(\’setGridParam\’, { sortname: \’AUTO_ID\’, sortorder: \’desc\’ }); console.log(\”Sort parameters set.\”); jQuery(\”#\” + grid).trigger(\’reloadGrid\’); console.log(\”Grid reload triggered.\”); }
Hello,
Yes, onAfterClone JS event is added in latest build.
If you are already sorting the grid rows on auto-id desc, In order to reload grid and show latest row you just need to show the first page. The newly cloned row will be on top.
For that edit jqgrid_dist.php, find this code: fx_clone_row = function (grid,id) { … }
and inside this function, change
jQuery(“#”+grid).trigger(‘reloadGrid’,[{jqgrid_page:1}]);
to
jQuery(“#”+grid).trigger(‘reloadGrid’,[{page:1}]);
hello, Any comments?