new DataTable(input)
To create an instance, use factory method App.dataTable.create
Parameters:
Name | Type | Description |
---|---|---|
input |
Methods
addRow()
Adds a row to the table based on the passed in data.
adjustModalTableContent()
tableui.js
alignTable()
tableui.js
cellRenderer()
See https://datatables.net/reference/option/columns.render#function
dataHandler(row, type, meta)
See https://datatables.net/reference/option/columns.data#function
Called when to get/set data from a cell.
Parameters:
Name | Type | Description |
---|---|---|
row |
The current row |
|
type |
set or get |
|
meta |
Meta data for the data-table |
destroy()
Destroys datatable widget instance
expandAndFindRow(objectId, parentIdopt)
Finds the passed in objectId's structure table row among the parent or selected rows' children
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
objectId |
string | Child row to find |
||
parentId |
string |
<optional> |
First selected object
|
Parent row to look under (optional), will default to first selected object |
exportToCsv()
Export table to CSV
exportToExcel()
Export table to excel
exportToPdf()
Export table to PDF
getAddColumnService()
Adds new column to the table
getMode()
Returns the mode: "VIEW" if no cell is being edited, otherwise "EDIT"
getRenderedRowCount() → {number}
Returns number of rows currently rendered in the table (includes pagination)
Returns:
- Type
- number
getRowId()
Returns the row id of the cell in which action is performed.
Returns:
String Returns the row id of the cell on which action is performed
getSelectedObjectIds() → {Array}
Returns a list of currently selected object ids in the table
Returns:
selected object ids or []
- Type
- Array
getTable() → {*|jQuery}
Return the JQ object of table
Returns:
- Type
- * | jQuery
loadDataFromSearch(query) → {promise}
Peforms search and loads data into datatable
Parameters:
Name | Type | Description |
---|---|---|
query |
array | search criteria * |
Returns:
search promise
- Type
- promise
performSearch(value)
Searches datatable for value and redraws table with matched criteria
Parameters:
Name | Type | Description |
---|---|---|
value |
string | search criterion |
refreshRow(rowId, flag)
Refreshes a particular row in datatable after fetching the fresh data from server
Parameters:
Name | Type | Description |
---|---|---|
rowId |
String | Id of the row to be refreshed |
flag |
boolean | defaults to false, if true redraws the table so if in responsive table hidden columns are visible it will be collapsed |
refreshRowByObjectIds(objectIds, flag)
Refreshes all the rows with the objectIds
Parameters:
Name | Type | Description |
---|---|---|
objectIds |
Array | Object Ids of the rows to be refreshed |
flag |
boolean | defaults to false, if true redraws the table so if in responsive table hidden columns are visible it will be collapsed |
reloadContent()
Reloads the table content
removeSelectedRows()
Remove the selected rows from datatable
selectedObjects() → {Object}
Returns the current selected rows as objects from the client store
Returns:
An object with objectIds as keys and the 'data' property containing the object data
- Type
- Object
selectedRows() → {Array.<Object>}
Returns the current selected rows.
Returns:
An array containing objects representing the current selected rows
- Type
- Array.<Object>
toggleAll(markAll)
Parameters:
Name | Type | Default | Description |
---|---|---|---|
markAll |
boolean |
false
|
Determines if items in the data is selected or unselected. Passing true will select all items. |
updateTableBeanOnServer()
Synch table bean with the one received from client