Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagexml
<input 
	type = "text"
	data-single-click = "true"
	value = {{ BENE_ID }}
	data-column-id = "BENE_ID"
>
<!-- BENE_ID is the Reference Number column's ID. -->

On a Cell Double Click, the column ID is returned followed by the template configuration (value) and the row details. On a Row Double Click the column ID is returned followed by the row details and the template configuration (value) as shown in the following image:

...

  • Cell Double Click event

    Code Block
    languagejs
    CWEH.registerHandler('BENE_WGT', CWEC.CELL_DBLCLICK, function(columnId, value, record)
    {
    	LOGGER.info('The CELL_DBLCLICK event is triggered.', [columnId, value, record]);
    });
    
    // Here, 'BENE_WGT' is the widget ID.


  • Row Double Click event

    Code Block
    languagejs
    CWEH.registerHandler('BENE_WGT', CWEC.ROW_DBLCLICK, function(columnId, record, value)
    {
    	LOGGER.info('The ROW_DBLCLICK event is triggered.', [columnId, record, value]);
    });
    
    // Here, 'BENE_WGT' is the widget ID.


Change Event

The Change event occurs when the value of an element is changed. For example, selecting or deselecting a checkbox or radio button. The Change event also raises the Cell Click and Row Click events.

Note

The Change event is applicable only for checkboxes and radio buttons.

For the Change event to function, the attribute data-input = "true" must be defined. As we are configuring the template for a column, we need to define the attribute data-column-id = '<Column ID>' as well.

For example, when you select and deselect the checkbox of a reference number on the Reference Number column of the Beneficiary Details widget, the Change event is triggered.

Image Added

To achieve this you need to define the Change event attributes in the Column Template as follows:

Code Block
languagexml
<input 
	type = 'checkbox'
	data-input = "true"
	data-column-id = 'BENE_ID'
>
<!-- BENE_ID is the Reference Number column's ID. -->

When you select the checkbox, the Change event triggers and the row data followed by the column ID and the template configuration (value) is returned. An additional attribute data-checked = ”checked” is added to the template configuration. When the checkbox is deselected this attribute gets removed from the template configuration as shown in the following screen shots:

  • After selecting the checkbox:

    Image Added

  • After deselecting the checkbox:

    Image Added

To capture actions through the Change event, use the event handler functions. For the Reference Number column, you need to capture the actions as follows:

Code Block
languagejs
CWEH.registerHandler(‘BENE_WGT’, CWEC.CELL_DATA_CHANGE, function(record, columnId, value)
{
	LOGGER.info('fired CELL DATA CHANGE', [record, columnId, value]);
});
// Here, 'BENE_WGT' is the widget ID.