cObject
---cWebObject
------cWebBaseUIObject
---------cWebListSwipeButton
This class can be used to add 'swipe buttons' inside a cWebList instance.
A swipe button is invisible until the user performs a horizontal swipe on the row. An alternative to swiping is the usage of the cursor keys (right and left arrow) to show the buttons on the current row. Opening swipe buttons on one row will close swipe buttons on other rows and on the other side of the same row. Multiple swipe buttons can be available on both the left and the right side of the list. The pbPositionLeft property determines whether they should be shown on the left or on the right.
The code sample below would be placed inside a cWebList instance. It shows a swipe button on the left side. Note that the color is determined by the CSS class "Highlight". Also available are the default style (no CSS Class) and "Danger" the icon comes from the "WebIcon_Info" class.
Object oSwipeDetails is a cWebListSwipeButton
Set psCaption to "Details"
Set piWidth to 100
Set pbPositionLeft to True
Set psCSSClass to "WebIcon_Info Highlight"
Procedure OnClick
Send NavigateForward to oZoomCustomer Self
End_Procedure
End_Object
The button can be customized per row by setting pbDynamic to True and implementing OnDefineButton. When OnDefineButton is triggered, the global record buffer contains the record for the current row. The two parameters passed by reference can be changed to hide the button or customize the caption.
The example below will only show the button on active customers by moving false to bRender for inactive customers. Note that OnDefineCSSClass can be augmented to customize the CSS class per row.
Object oSwipeDetails is a cWebListSwipeButton
Set psCaption to "Details"
Set piWidth to 100
Set pbPositionLeft to True
Set psCSSClass to "WebIcon_Info Highlight"
Set pbDynamic to True
Procedure OnClick
Send NavigateForward to oZoomCustomer Self
End_Procedure
Procedure OnDefineButton Boolean ByRef bRender String ByRef sCaption
If (Customer.Status <> "Y") Begin
Move False to bRender
End
End_Procedure
End_Object
This control can be used as a valid drop target by registering it as such in a cWebDragDropHelper object.
The supported actions for this control are:
- C_WebDropOnControl
This allows the control to accept data dragged from elsewhere in the control (if configured that way) and can also be used to accept files when registered within a cWebDragDropFileHelper.