Skip to main content

Table Events

Events fired by the Table Widget in Data Mode. All events on this page trigger FormHostProvider.runFormEvent.

note

widgetContext and widgetValue are transmitted as JSON-encoded strings on the wire. The values shown below are the deserialized structures.


onTableLoadData​

Fired on initial table load and whenever the user interacts with a pagination control (rows per page, page number, next/previous).

Requires Pagination and Lazy Loading to be enabled on the Table Widget.

{
"pluginCode": "construct",
"formCode": "documents",
"guid": "index",
"projectGuid": "38I9rEPw1BmxP75XcxgzD5WGOk1",
"pGuid": "38I9rEPw1BmxP75XcxgzD5WGOk1",
"formData": {},
"widgetsState": null,
"widgetName": "documentstbl",
"widgetEvent": "onTableLoadData",
"DataTableMeta": {
"serverPaginationEnabled": true,
"rowsPerPage": 20,
"pageIndex": 0,
"nextToken": "",
"previousToken": "",
"paginationDirection": "next",
"rowCount": -1,
"qId": "",
"lastRequestLimit": 20,
"oppositeDirection": false
},
"widgetContext": {
"referer": "/forms/documents/index",
"parentWidgetId": null,
"hasParentForm": false,
"originator": null,
"parent": null,
"folderData": null
}
}

onTableEditLoadData​

Fired when the Table Widget is in Data Mode and initializes for editing.

{
"pluginCode": "construct",
"formCode": "documents",
"guid": "index",
"projectGuid": "38I9rEPw1BmxP75XcxgzD5WGOk1",
"pGuid": "38I9rEPw1BmxP75XcxgzD5WGOk1",
"formData": {},
"widgetsState": null,
"widgetName": "documentstbl",
"widgetEvent": "onTableEditLoadData",
"DataTableMeta": {
"serverPaginationEnabled": true,
"rowsPerPage": 20,
"pageIndex": 0,
"nextToken": "",
"previousToken": "",
"paginationDirection": "next",
"rowCount": -1,
"qId": "",
"lastRequestLimit": 20,
"oppositeDirection": false
},
"widgetContext": {
"referer": "/forms/documents/index",
"parentWidgetId": null,
"hasParentForm": false,
"originator": null,
"parent": null,
"folderData": null
}
}

onTableCreateRecordEvent​

Fired when the user clicks the Add button in a Data Mode table. The backend should respond with an OpenModal command to display a record creation form.

{
"pluginCode": "construct",
"formCode": "documents",
"guid": "index",
"projectGuid": "38I9rEPw1BmxP75XcxgzD5WGOk1",
"pGuid": "38I9rEPw1BmxP75XcxgzD5WGOk1",
"formData": {},
"widgetsState": null,
"widgetName": "documentstbl",
"widgetValue": null,
"widgetEvent": "onTableCreateRecordEvent",
"widgetContext": {
"referer": "/forms/documents/index",
"parentWidgetId": null,
"hasParentForm": false,
"parentOriginator": { "params": {} },
"originator": {
"params": { "pluginCode": "construct", "formCode": "documents", "guid": "index", "pGuid": "38I9rEPw1BmxP75XcxgzD5WGOk1" },
"widgetName": "documentstbl"
},
"parent": {
"widgetName": "documentstbl",
"params": { "pluginCode": "construct", "formCode": "documents", "guid": "index", "pGuid": "38I9rEPw1BmxP75XcxgzD5WGOk1" }
},
"isModal": false,
"folderData": null
}
}

onTableRunActionEvent​

Fired when the user selects a row-level action from the row action menu or flat buttons.

widgetValue contains the selected action name and the target row data.

{
"pluginCode": "construct",
"formCode": "documents",
"guid": "index",
"projectGuid": "38I9rEPw1BmxP75XcxgzD5WGOk1",
"pGuid": "38I9rEPw1BmxP75XcxgzD5WGOk1",
"formData": {},
"widgetsState": null,
"widgetName": "documentstbl",
"widgetEvent": "onTableRunActionEvent",
"widgetValue": {
"action": "edit",
"rowData": {
"_id": "rec-001",
"_sk": "DOC#001",
"_code": "DOC001",
"_origformcode": "documents",
"_plugincode": "construct"
}
},
"widgetContext": {
"referer": "/forms/documents/index",
"parentWidgetId": null,
"hasParentForm": false,
"originator": {
"widgetName": "documentstbl",
"params": { "pluginCode": "construct", "formCode": "documents", "guid": "index", "pGuid": "38I9rEPw1BmxP75XcxgzD5WGOk1" }
},
"parent": {
"widgetName": "documentstbl",
"params": { "pluginCode": "construct", "formCode": "documents", "guid": "index", "pGuid": "38I9rEPw1BmxP75XcxgzD5WGOk1" }
},
"folderData": null
}
}

onTableRunBatchActionEvent​

Fired when the user clicks Download or Delete from the top toolbar after selecting one or more rows.

widgetValue contains the action name and the full list of selected rows.

{
"pluginCode": "construct",
"formCode": "documents",
"guid": "index",
"projectGuid": "38I9rEPw1BmxP75XcxgzD5WGOk1",
"pGuid": "38I9rEPw1BmxP75XcxgzD5WGOk1",
"formData": {},
"widgetsState": null,
"widgetName": "documentstbl",
"widgetEvent": "onTableRunBatchActionEvent",
"widgetValue": {
"action": "delete",
"data": [
{ "_id": "rec-001", "_code": "DOC001", "_origformcode": "documents", "_plugincode": "construct" },
{ "_id": "rec-002", "_code": "DOC002", "_origformcode": "documents", "_plugincode": "construct" }
]
},
"widgetContext": {
"referer": "/forms/documents/index",
"parentWidgetId": null,
"hasParentForm": false,
"originator": {
"widgetName": "documentstbl",
"params": { "pluginCode": "construct", "formCode": "documents", "guid": "index", "pGuid": "38I9rEPw1BmxP75XcxgzD5WGOk1" }
},
"parent": {
"widgetName": "documentstbl",
"params": { "pluginCode": "construct", "formCode": "documents", "guid": "index", "pGuid": "38I9rEPw1BmxP75XcxgzD5WGOk1" }
},
"parentOriginator": { "params": {} },
"folderData": null
}
}