control.topLevelForm.actionbar.getActionItemByName()
- Last UpdatedJun 25, 2024
- 1 minute read
Use control.topLevelForm.actionbar.getActionItemByName() method to get the Action Item by design-time name. Using this API, you can change the Visible and/or Enable properties of the Action Item as shown in the example below.
Syntax
var actionItem = control.topLevelForm.actionbar.getActionItemByName("actionItemName");
Parameters
|
Parameter |
Description |
|---|---|
|
actionItemName |
Name of the action item. |
Return Value
None.
Examples
Toggle the Visible property of the Action Item using a Button Click script
//New Action Item1 represents the name of the Action Item.
var actionItem = control.topLevelForm.actionbar.getActionItemByName("New Action Item1");
if(!SFU.isUndefined(actionItem))
{
actionItem.visible= !actionItem.visible;
}
Toggle the Enable property of the Action Item using a Button Click script
//New Action Item1 represents the name of the Action Item.
var actionItem = control.topLevelForm.actionbar.getActionItemByName("New Action Item1");
if(!SFU.isUndefined(actionItem))
{
actionItem.enable= !actionItem.enable;
}