OnElemClick - cWebHtmlList
Called when a specific element is clicked within the list
Type: Event
Parameters
| Parameter | Type | Description |
|---|---|---|
| sRowId | String | RowId of the clicked element |
| sParam | String | The value of the data-ServerOnElemClick |
Syntax
Procedure OnElemClick String sRowId String sParam
Description
This event is called when an element is clicked within a row that has the data-ServerOnElemClick attribute set on it.
Sample
The example below shows how data-ServerOnElemClick is set and OnElemClick is implemented to handle the click event.
Object oWebVendorHtmlList is a cWebHtmlList
Set psHtmlBefore to '<table>'
Set psHtmlTemplate to '<td><td>{{oVendor_Name}}</td><td>{{oInventory_Item_ID}}</td><td>{{oInventory_Description}}</td><td><a data-ServerOnElemClick="Details">Details..</a></tr>'
Set psHtmlAfter to '</table>'
Object oVendor_Name is a cWebColumn
Entry_Item Vendor.Name
End_Object
Object oInventory_Item_ID is a cWebColumn
Entry_Item Inventory.Item_ID
End_Object
Object oInventory_Description is a cWebColumn
Entry_Item Inventory.Description
End_Object
Procedure OnElemClick String sRowId String sParam
Send ShowInfoBox (SFormat("Clicked %1 on row %2", sParam, sRowId))
End_Procedure
End_Object