|Type||Topic||Plugin||Version||macOS||Windows||Linux||Console & Web||iOS|
|class||Cocoa Controls||MBS CocoaControls Plugin||17.1||Yes||No||No||Yes, macOS only||No|
In an editable table, performing a horizontal swipe on a row reveals a button to delete the row by default. This class lets you define one or more custom actions to display for a given row in your table. Each instance of this class represents a single action to perform and includes the text, formatting information, and behavior for the corresponding button.
To add custom actions to your table view’s rows, implement the rowActionsForRow event in your table view’s delegate object. In that method, create and return an array of actions for the specified row. The table handles the remaining work of displaying the action buttons and executing the appropriate handler block when the user clicks the button.
- event Action(row as Integer)
- 5 properties
- method Constructor(Style as Integer, Title as String)
- shared method available as boolean
- 2 constants
Apply a style that indicates that the action might change or delete data. This style changes the value of the backgroundColor property to an appropriate value to reflect the destructive action. After creating the action object, you can change the background color as needed. Destructive actions require a longer swipe to activate, and trigger an animation when a table row is deleted.
Apply the default style to the button. This style does not apply any special coloring to the button.
This class has no sub classes.
Some events for this class:
- NSTableControlMBS.rowActionsForRow(row as Integer, edge as Integer) as NSTableViewRowActionMBS()
The items on this page are in the following plugins: MBS CocoaControls Plugin.
MBS Xojo PDF Plugins