sc_actionbar_enable("boton_nombre")
|
|
Enables the action bar button, making it available for clicking.
This macro can be used for any type of button (link or ajax) on the action bar.
Parameter definition
| Parameter |
Syntax |
Description |
| button_name |
It is not possible to use variables, the name of the button must be informed using double quotes or single quotes
Example
sc_actionbar_enable("ajax_btn");
|
This parameter is mandatory.
We must inform the name of the action bar button that will be enabled.
|
Examples
Example 1: Basic macro usage
sc_actionbar_enable("button_name");
Example 2: Enabling the link button to the order detail if there is any record to be displayed.
// Example created in the onRecord event of the grid using the order table and orderdetail table
// If there are no items ordered in the measurement, the button will be disabled
$query = "SELECT count(*) FROM OrderDetails WHERE OrderID =" . {OrderID};
sc_lookup(ds, $query);
if ({ds[0][0]} <> 0) {
//Example of using the sc_actionbar_enable macro
sc_actionbar_enable("button_name");
} else {
sc_actionbar_disable("button_name");
}
|
Macro Scope
|
Grid application
|
ajaxFieldonClick onRecord
|
|