sfHideGroupButtons
Hides action buttons from a group control to make the action unavailable. A group control has multiple action buttons to add or delete rows or to sort them.
Syntax
sfHideGroupButtons(id, actionType)
Parameters
Name | Type | Mandatory | Description |
---|---|---|---|
id | string | yes | Control id of the group control. |
actionType | string | yes | Action to be made unavailable in the group control. |
action types
Name | Description |
---|---|
addBottom | Corresponds to the independent Add button at the bottom of a group control. It appends a new row to the group control. |
addContext | Corresponds to the plus icon in the context menu of a row. It inserts a new row at the position in the group control. |
delete | Corresponds to the cross icon in the context menu of a row. It delete the row at the position in the group control. |
move | Corresponds to the up and down arrows in the context menu of a row. It moves the position of the row in the group control. |
all | Used to hide all the actions mentioned above. |
Usage examples
Example 1
Let us consider a group control ProductsList that is populated from a dataset Products. To prevent the user from adding new products to the group control, the Add buttons in the context menu and at the bottom of the control can be removed as,
sfHideGroupButtons('control_productslist','addBottom');
sfHideGroupButtons('control_productslist','addContext');
Example 2
Consider the example above. To prevent the user from making any alterations to the list i.e. to prevent the user from adding or removing a row as well as changing the position of the products,
sfHideGroupButtons('control_productslist','all');