sc_actionbar_disable("button_name")
|
|
Disables the action bar button, making it unavailable 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_disable("ajax_btn");
|
This parameter is mandatory.
We must inform the name of the action bar button that will be disabled.
|
Examples
Example 1: Basic macro usage
sc_actionbar_disable("link_detalhe");
Example 2: Disabling the link button to the order detail if there are no items in the order.
// Example created in the onRecord event of the grid using the order and orderdetail table
// If there are no items in the order, the button will be disabled
$query = "SELECT count(*) FROM OrderDetails WHERE OrderID = ". {OrderID};
sc_lookup(ds, $query);
if ({ds[0][0]} == 0) {
//Exemplo de utilização da macro sc_actionbar_disable
sc_actionbar_disable("button_name");
} else {
sc_actionbar_enable("button_name"); }
|
Macro Scope
|
Grid application
|
ajaxFieldonClick onRecord
|
|