sc_actionbar_clicked_state()

The sc_actionbar_clicked_state() macro makes it possible for the developer to retrieve the current state of the button at the time of clicking the ajax button on the action bar.

This way you can validate the current state of the button and change it according to your business rule.

This macro is exclusive for using the ajax event of the action bar button.

Examples


Example: Identification of the current state of the button in the ajax event, to change the state when clicking.

if (sc_actionbar_clicked_state() == 'pending') {

sc_actionbar_state('ajax_btn', 'sent');


} else {

sc_actionbar_state('ajax_btn', 'pending');

}

 

Example: Example for viewing the current value of the button.

echo sc_actionbar_clicked_state();