i
Table
A table is obtained by $d.getTable(idElement, indexElement).
The methods that modify the table return the same instance, allowing operations to be chained, except for the methods that create and delete rows, which return a promise.
Class Methods
Name |
Description |
Result |
|---|---|---|
setAllowColumnResize(allowResize) |
Enables or disables column resizing.
Parameter •Boolean allowResize: Indicates whether resizing columns is allowed. |
Table |
setDataSource(idDataSource, props, reset) |
Assigns a Datasource to the table.
Parameters •String idDataSource: Datasource Identifier •Object props (optional): Table permission settings; may include canModify, canDelete and canCreate. •Boolean reset (optional): Indicates whether the current data should be reset. |
Table |
getDataSource() |
Returns the UUID of the Datasource configured in the table. |
String |
getDataSourceId() |
Returns the identifier of the Datasource configured in the table. |
String | null |
getTotalPages() |
Returns the total number of pages in the table's DataSource. |
Number |
getPage() |
Returns the current page number. |
Number |
getTotalItems() |
Returns the total number of records in the Datasource. |
Number |
getPerPage() |
Returns the number of records per page. |
Number |
getData() |
Returns the records from the current page of the table. |
Object[] |
getRowData(row) |
Returns the data from one row.
Parameter •Number row: Row index. |
Object |
setRowData(row, data) |
Updates the data in a row.
Parameters •Number row: Row index. •Object data: Data to be assigned to the row. |
Table |
modifyRow(row) |
Starts editing a row. If another row was already being edited, the previous editing session is canceled.
Parameter •Number row: Index of the row to be edited. |
Promise<Table> |
crollTo(row, cell) |
Moves the table to one row and one cell.
Parameters •Number row: Row index. •Number cell: Column or cell index. |
Table |
getModifyingRow() |
Returns the index of the row that is being edited. |
Number | null |
getHeader() |
Returns the table header. |
TableHeader |
getRow(row) |
Returns a row from the table.
Parameter •Number row: Row index. |
TableRow |
getPlaceholder() |
Returns the placeholder of the table. |
TablePlaceholder |
getChangedRows() |
Returns the table's change history. Each record contains operation ("CREATE", "MODIFY" or "DELETE"), index (Number), row (Object or null) and tableId (String). |
TableOperationRecord[ |
refresh() |
Re-executes the configured Datasource and updates the table data. |
Table |
createItem(order, index) |
Creates a row in the table. Parameters •String order: Insertion order; it can be "start" or "end". •Number index (optional): Index where the row will be inserted. |
Promise<Table> |
deleteItem(index) |
Deletes a row from the table.
Parameter •Number index: Index of the row to be deleted. |
Promise<Table> |
beforeRowModify(callback) |
Registers a function that is executed before modifying a row.
Parameter •Function callback: Receives (rowData, index) and can return undefined or boolean. |
Table |
beforeRowCreate(callback) |
Registers a function that is executed before creating a row.
Parameter •Function callback: Receives (rowData, index) and can return undefined or boolean. |
Table |
beforeRowDelete(callback) |
Registers a function that is executed before creating a row.
Parameter •Function callback: Receives (rowData, index) and can return undefined or boolean. |
Table |
beforeRowSave(callback) |
Registers a function that is executed before saving a row.
Parameter •Function callback: Receives (rowData, index) and can return undefined, Object or boolean. |
Table |
TableHeader Class Methods
Name |
Description |
Result |
|---|---|---|
getColumn(column) |
Returns a column from the header.
Parameter •Number column: Column index. |
Table |
TableColumn Class Methods
Name |
Description |
Result |
|---|---|---|
setVisible(visible) |
Shows or hides the column and its corresponding cell.
Parameter •Boolean visible: Indicates whether the column should be visible. |
TableColumn |
setTitle(title) |
Changes the column title.
Parameter •String title: New title. |
TableColumn |
setAllowOrder(allowOrder) |
Enables or disables column sorting.
Parameter •Boolean allowOrder: Indicates whether sorting is allowed. |
TableColumn |
setAllowHide(allowHide) |
Enables or disables the option to hide the column.
Parameter •Boolean allowHide: Indicates whether hiding is allowed. |
TableColumn |
setAllowFixed(allowFixed) |
Enables or disables the ability to pin the column.
Parameter •Boolean allowFixed: Indicates whether piinning is allowed. |
TableColumn |
setFixed(fixed) |
Fixes or releases the column.
Parameter •Boolean fixed: Indicates whether the column should remain fixed. |
TableColumn |
getField() |
Returns the Datasource field associated with the column. |
String | null |
TableRow Class Methods
Name |
Description |
Result |
|---|---|---|
setShowActionsOnHover(value) |
Configures whether row actions are displayed when hovering over the cursor.
Parameter •Boolean value: Indicates whether actions are displayed when hovering over the cursor. |
TableRow |
getCell(column) |
Returns a cell from the row.
Parameter •Number column: Column index. |
TableCell | null |
TableCell Class Methods
Name |
Description |
Result |
|---|---|---|
setVisible(visible) |
Shows or hides the cell and its corresponding column.
Parameter •Boolean visible: Indicates whether the cell should be visible. |
TableCell |
TableActions Class Methods
Name |
Description |
Result |
|---|---|---|
setCanModify(value) |
Enables or disables row update.
Parameter •Boolean value: Indicates whether updating is allowed. |
TableActions |
setCanCreate(value) |
Enables or disables row building.
Parameter •Boolean value: Indicates whether building is allowed. |
TableActions |
setCreateOrder(order) |
Configures the insertion order for new rows.
Parameter •String order: Could be "start" or "end". |
TableActions |
setCanDelete(value) |
Enables or disables row deletion.
Parameter •Boolean value: Indicates whether deletion is allowed. |
TableActions |
Methods of the TablePlaceholder Class
The table placeholder does not have specific methods; it exposes the general methods available for page elements.