Hello,
To edit grid, i'm using on_update event with this:
$e["on_update"] = array("my_function", null, false);
I'm trying to reload the grid after update with the following option but it doesn't work:
$opt["reloadedit"] = true;
$opt["edit_options"]["reloadAfterSubmit"]=True;
$opt["edit_options"]["afterSubmit"] = "function(){jQuery('#list1').trigger('reloadGrid',[{current:true}]); return [true, ''];}";
Is the any special things to do when i use on_update event ?
Thanks
I just saw that even if i click on "reload button" on the grid it doesn't work.
I load the grid from an array.
Do the reload features work when we load grid from an array ?
Thanks
Mofel
Loading grid from array cache all data in local JS variable, so reload will not be apparent.
If you want to fetch data again from server then some custom php / js / ajax code would be required.
If you can email me your grid code, i can suggest the changes.
HEllo Abu i have two grids in the same page, im triying to refresh the second grid after bulk edit in the first grid but it is not reloading the second grid:
i already tried this:
$grid["bulkedit_options"]["afterShowForm"] = "function(){jQuery('#list2').trigger('reloadGrid',[{current:true}]);}";
i also tried by creating a custom fuction and calling the reloadGrid but it neither work:
$e["on_update"] = array("refresh","",true);
$g->set_events($e);
function refres($data)
{
jQuery('#list2').trigger('reloadGrid',[{current:true}]); // if i add this line the page wont even load.
}
Try:
$grid["bulkedit_options"]["afterShowForm"] = "function(){ jQuery('#sData').click( function(){ jQuery('#list2').trigger('reloadGrid',[{current:true}]); } ); }";
Binded refresh code on submit button click event.
You can put alert() before reloadGrid line to debug.
I added the line that you suggested and the second grid is still not refreshing.I dont get it why if i put this line
jQuery('#list2').trigger('reloadGrid',[{current:true}]);
within the function trigered by the custom button the page wont load, if i take it off the rest of the code within the function works properly.
You can try debugging it by alerting something. Also check browser error console for error. (F12)
$grid["bulkedit_options"]["afterShowForm"] = "function(){ jQuery('#sData').click( function(){ alert('test'); } ); }";
If your solution is online, then share online url.