Grid Actionbar don't execute ajax

Hi,

I have a grid with action bar and 2 state.
I have ajax code to change statut of record but when i click on action button, I have any response.

DO you have any Idea ?

Ajax code
if (sc_actionbar_clicked_state() == “Non”) {
$update = "UPDATE entity_doa SET entity_doa.enabled = 1 WHERE entity_doa.id = " . {ed.id};
sc_actionbar_state(“Change”, “Oui”);
sc_alert (“Message”, $update);
}
elseif (sc_actionbar_clicked_state() == “Oui”) {
$update = "UPDATE entity_doa SET entity_doa.enabled = 0 WHERE entity_doa.id = " . {ed.id};
sc_actionbar_state(“Change”, “Non”);
sc_alert (“Message”, $update);
}
sc_exec_sql ($update);

1 Like

I’m having the same issue here. Did you find any solution?

Edit: I just cleared cache and it worked for me

I had the same issue! After clearing the cache and temporary files, it worked!

But I have another issue on the ajax execution. Did you ever tried to create an additional field, do assign a value to it and to share this field variable for the ajax PHP? The field within the grid will be filled but in the ajax, this field is still empty. Only fields coming from the grid query contain a value.
Did you ever incur in this issue? In my opinion this is a bug.

Update: most probably this issue was caused by the same cache clearance issue! After clearing the cache and recompiling the app a couple of times, the problem suddenly disappeared.