Hi,
I have been using the on_after_insert and on_after_update for my data modification in the grid. I need to return an array from this function and pass this array to a javascript function. Is there any way I can do this?
1 Answers
Hello,
The event does not auto-return any data as it's done with ajax call that uses generic json format.
You can use,
$opt["add_options"]["afterSubmit"] = "function(response) { ………. }";
$opt["edit_options"]["afterSubmit"] = "function(response) { ………. }";
…
$g->set_options($opt);
And return json format array from event handler that can be obtained in response var in js function.
Then you can parse json and pass to js function: jQuery.parseJSON(response.responseText)
I've not verified this flow, but this could be your solution.
Your Answer