...
The Column Template supports the following events:
- Cell Click and Row Click events
- Cell Double-Click and Row Double-Click events
- Change event
- Context Click event
Note |
---|
Whether you define a Cell Click, Row Click, Cell Double Click, Row Double Click, Change or a Context Click event, the data that is returned will be:
|
Anchor | ||||
---|---|---|---|---|
|
The Cell Click event occurs when a cell is clicked once. The Cell Click event also raises the Row Click event.
...
Cell Click event
Code Block language js CWEH.registerHandler('BENE_WGT', CWEC.CELL_CLICK, function(columnId, value, record) { LOGGER.info('The CELL_CLICK event is captured', [columnId, value, record]); }); // Here, 'BENE_WGT' is the widget ID.
Row Click event
Code Block language js CWEH.registerHandler('BENE_WGT', CWEC.ROW_CLICK, function(columnId, record, value) { LOGGER.info('The ROW_CLICK event is captured.', [columnId, record, value]); }); // Here, 'BENE_WGT' is the widget ID.
Anchor | ||||
---|---|---|---|---|
|
The Cell Double Click event occurs when a cell is clicked twice. The Cell Double Click event also raises the Row Double Click event.
...
Cell Double Click event
Code Block language js CWEH.registerHandler('BENE_WGT', CWEC.CELL_DBLCLICK, function(columnId, value, record) { LOGGER.info('The CELL_DBLCLICK event is captured.', [columnId, value, record]); }); // Here, 'BENE_WGT' is the widget ID.
Row Double Click event
Code Block language js CWEH.registerHandler('BENE_WGT', CWEC.ROW_DBLCLICK, function(columnId, record, value) { LOGGER.info('The ROW_DBLCLICK event is captured.', [columnId, record, value]); }); // Here, 'BENE_WGT' is the widget ID.
Anchor | ||||
---|---|---|---|---|
|
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.
...
Code Block | ||
---|---|---|
| ||
CWEH.registerHandler(‘BENE_WGT’, CWEC.CELL_DATA_CHANGE, function(record, columnId, value) { LOGGER.info('The CELL DATA CHANGE event is captured.', [record, columnId, value]); }); // Here, 'BENE_WGT' is the widget ID. |
Anchor | ||||
---|---|---|---|---|
|
A Context Click event is raised when you right-click on a cell, column or row in the widget. For example, when you right-click on a cell of the Widget Activity Summary > Saved widget, a context menu with edit and delete option appears.
...
On a Context Click, the column ID is returned followed by the template configuration (value) and the row details as shown in the following image:
...
Whether you define a Cell Click, Row Click, Cell Double Click, Row Double Click, Change or a Context Click event, the data that is returned will be:
...
The template configuration code for the Reference Number column is as follows:
Code Block | ||
---|---|---|
| ||
{{ #if tplData }}
<input
data-input = 'true'
type = 'text'
value = {{ tplData }}
data-column-id = 'BENE_ID'
data-single-click = 'true'
data-context-click = "true"
>
{{ /if }}
<!-- BENE_ID is the Reference Number column's ID. --> |
To capture actions through the Context Click event, use the event handler functions. For the Reference Number column, you need to capture the actions as follows:
Code Block | ||
---|---|---|
| ||
CWEH.registerHandler('WGT_DRAFT', CWEC.CONTEXT_CLICK, function(columnId, value, record)
{
LOGGER.info('The CONTEXT_CLICK event is captured.', [columnId, value, record]);
});
// Here, 'WGT_DRAFT’ is the widget ID. |