Difference between revisions of "iOSMobileTableRowAction"

From Xojo Documentation

Line 9: Line 9:
  
 
<dynamicTable id="Properties" class="propertyTable" title="Properties" columns="3">
 
<dynamicTable id="Properties" class="propertyTable" title="Properties" columns="3">
{{Property | name=Handle | readonly=yes | description=(Ptr) Used for creating Declares to the underlying UITableViewRowAction object.}}
+
{{Property | name=Handle | readonly=yes | type=Ptr | description=(Ptr)&nbsp;&nbsp;Used for creating Declares to the underlying UITableViewRowAction object.}}
{{Property | name=Style | readonly=yes | description=(Styles) A value from the Styles enum to indicate how the row action displays.}}
+
{{Property | name=Style | readonly=yes | type=iOSMobileTableRowAction.Styles | description=(iOSMobileTableRowAction.Styles)&nbsp;&nbsp;A value from the Styles enum to indicate how the row action displays.}}
{{Property | name=Tag | description=(Variant) A value to associate with the action. This value will be passed into the iOSMobileTable.RowAction event and allows you to determine which action was selected. As an Auto, there are no limitations on the value you supply.}}
+
{{Property | name=Tag | type=Variant | description=(Variant)&nbsp;&nbsp;A value to associate with the action. This value will be passed into the iOSMobileTable.RowAction event and allows you to determine which action was selected. As an Auto, there are no limitations on the value you supply.}}
{{Property | name=Title | description=(String) The title of the button. This is displayed to the user and therefore should be localized.}}
+
{{Property | name=Title | type=String | description=(String)&nbsp;&nbsp;The title of the button. This is displayed to the user and therefore should be localized.}}
 
</dynamicTable>
 
</dynamicTable>
  

Revision as of 23:59, 26 March 2021

Class (inherits from Object)

New in 2020r2

An iOSMobileTableRowAction represents a single action that a user can take when swiping horizontally on an iOSMobileTable row. Multiple actions may be added. As of iOS 8 an action is presented as a button near the trailing edge of the row. This class is used in conjunction with the iOSMobileTable.ApplyActionsForRow event.

Properties
Handle fa-lock-32.png Tag
Style fa-lock-32.png Title
Enumerations
Styles
Constructors

Constructor(style As Styles, title As String, Optional tag As Variant)


Notes

Row actions only work for tables that use iOSMobileTableDataSourceEditing and where its AllowRowEditing method returns True.

Sample Code

This class is used in the iOSMobileTable.ApplyActionsForRow event to set up the actions. The iOSMobileTable.RowActionSelected event is called when an action is used. This is how you would set it up in the iOSMobileTable events:

Event ApplyActionsForRow(section As Integer, row As Integer) As iOSMobileTableRowAction()
Var actions(1) As iOSMobileTableRowAction
' Create the More button
actions(0) = New iOSMobileTableRowAction(iOSMobileTableRowAction.Styles.Normal, "More...", "More")
' Create the Delete button
actions(1) = New iOSMobileTableRowAction(iOSMobileTableRowAction.Styles.Destructive, "Delete", "Delete")
Return actions
End Event

Event RowActionSelected(section As Integer, row As Integer, actionTag As Variant)
Select actionTag
Case "More"
// ... show more info
Case "Delete"
// ... delete something
End Select
End Event

See Also

iOSMobileTable class.