Service data table
Allows you to create a repeating table, which can be populated by using a service. It cannot be bound to a variable.

null

Appearance

Behavior

Performance

Events
On Load:
Description: Controls: Table, Service Data Table. This event is triggered when the table is loaded.
Example: me.setPageIndex(0);
On Custom Cell:
Description: Controls: Table, Service Data Table. This event fires whenever a cell loads with custom rendering options. In order to make use of this event, you must set the Render as configuration value to Custom in Columns.
Example: var div = document.createElement("div"); div.innerHTML = cell.row.data[cell.varName]; return div;
Context Variables cell {object}
Properties colIndex
controlType
parentNode
row {data, index}
varName
On Rows Loaded:
Description: Controls: Table, Service Data Table. This event is applicable only for paged tables, it fires when rows are displayed.
Example: alert("All rows have " + (all ? "" : "NOT") + " been loaded");
Context Variables all {boolean}
On Expandable Row Loaded:
Description: Controls: Table, Service Data Table. This event fires when an expandable row loads. In order to make use of this event, you must enable allow expandable rows config option.
Example when the row is rendered as Coach View: row.views.forEach(function(view) { switch(view.context.viewid) { case "Text1": view.setData(row.data[varName]); break; case "Text2": view.setData(row.data[varName]); break; } }); Example when the row is rendered as Custom: var div = document.createElement("div"); div.innerHTML = row.data[varName] + " " + row.data[varName]; return div;
Context Variables row {object}
Properties data
index
td
tr
views
On Row Expanded:
Description: Triggers when the row expands.
Example:
${Service_Call1}.execute();
On Row Collapsed:
Description: Triggers when the control collapses.
Example: alert("Collapsed row has index " + row.index);
On Row Selected:
Description: Controls: Table, Service Data Table. This event fires whenever a row is selected by the user.
Example: alert("Selected row has index " + row.recordIndex);
Context Variables row {object}
Properties index
data (object containing the table row data properties)
On All Rows Selected:
Description: Controls: Table, Service Data Table. This event fires whenever all rows in a table are selected or all rows are deselected.
Example: alert("All rows selected: " + all);
Context Variables all {boolean} True if all rows selected, false if all rows deselected
On Row Added:
Description: Controls: Table only. This event is called when a row is being added by the user through the Add Row button. If it returns a JavaScript object, then the object is added , otherwise an empty object is added.
Example: alert("New row will be added");
On Row Deleted:
Description: Controls: Table only. This event is fired when the user asks to delete a row. If the event returns false the row will not be deleted.
Example: return confirm("Are you sure you want to delete item " + item.str1);
Context Variables item {object}
Properties table row data properties
On Service Data Loaded:
Description: Controls: Service Data Table only. This event is triggered when AJAX service supplying the table data completes successfully.
Example: alert("AJAX service has returned with data");
On Service Data Error:
Description: Controls: Service Data Table only. This event is triggered when AJAX service supplying the table data completes unsuccessfully.
Example: alert("AJAX service has returned with an error");
On Sorting by Column Header:
Description: Controls: Table, Service Data Table. Activated when the user clicks the sort icon in a table column header. Return false to use the custom sorting and skip the default table sorting. You can use this event to set me.context.binding.set("value", myCustomSortedList) to a custom sorted list.
Example: alert("Sorting " + col + " column in " + order + " order"); me.context.binding.set("value", myCustomSortedList); return false;
Context Variables col {String} order {String}
On Page Sizer Change:
Description: Controls: Table, Service Data Table. Activated when the user changes the value for the per page input field.
Example: me.showPager(true);
Context Variables newSize {Integer} oldSize {Integer}
On Column Dropped:
Description: Controls: Table only. Activated when the user drags and drops a column.
Example: alert("Column dropped");
On Column Resize:
Description: Controls: Table only. Activated when the user resizes a column.
Example: alert("Column resized");
Extends:
com.ibm.bpm.coach.CoachView
Methods:

Inherited addClass(name, [replaced])
Add or replace the CSS classes for this view.
Example

appendElement(obj)
Adds the specified element to the table -- appendRecord() and add() are aliases to this method.
Examples

appendElements(objs)
Adds the specified elements/records to the table -- appendRecords() and addAll() are aliases to this method. Because adding an element causes the table to re-render, use this method for better performance while adding multiple records instead of repeatedly calling appendElement()
Example

clear()
Clear the records from this table (leaves it empty but the column headers remain)

clearSearch()
Clears the search filter and reloads the table

clearSort()
Clears the sort and redisplays the table

getColorStyle() Returns: {string}
Gets color style of table. NOTE: This always returns the color as set, to avoid ambiguity always set the color using "D"|"L"|"P"|"I"|"S"|"W"|"G"

getColumns() Returns: {object}
Gets column specifications for the Table

getFilteredRecords(col, exp, caseInsensitive, [useRegex]) Returns: {Object[]}
Returns the records matching the search parameters. This methods does not modify the table and is not affected by a table's existing filtering or sorting

getHeaderFooterStyle() Returns: {string}
Gets the current header foot style for the table

getHelpText() Returns: {string}
Get help text associated with Table control

getHighlightSelection()
This returns whether a row is highlighted when selected. Not in Service Data Tables

getMaxPageIndex() Returns: {integer}
Get the maximum page index

getPageIndex() Returns: {integer}
Returns the page index

getPageSize(index, actual) Returns: {integer}
Returns the page size

getQueryData() Returns: {any}
Gets the input for the AJAX Data Service. Service Data Tables only.

getRecord(index, asInTable) Returns: {Object}
Returns the record at the specific index

getRecordCount(asInTable) Returns: {integer}
Returns the number of records in the table

getRecordIndex(record, asInTable) Returns: {integer}
Returns the record at the specific index

getRecordOnPage(recIdx, pageIdx) Returns: {Object}
Returns the record at the index and page specified - respecting the sorting and filtering that may be active on the table.

getRecords(asInTable) Returns: {Object[]}
Returns the record at the specific index

getRecordsOnPage(pageIdx) Returns: {Object[]}
Returns the records at page index specified - respecting the sorting and filtering that may be active on the table.

getRowForView(v) Returns: {Row}
getRow is an alias for this method. Gets the row containing the specified child view. The row object can be used to retrieve data associated with the row [using .getData()], or any view instance on the row [using .getView()].

getSelectedIndex(asInTable) Returns: {integer}
Returns the selected record (if any)

getSelectedIndices(asInTable) Returns: {integer[]}
Returns the selected records (if any) - Note that the indices array may not always be sorted in ascending order of indices

getSelectedRecord(asInTable) Returns: {Object}
Returns the selected record (if any)

getSelectedRecordCount(asInTable) Returns: {integer}
Returns the selected record (if any)

getSelectedRecords(asInTable) Returns: {Object[]}
Return a list of selected records, if any

getTableStyle()
Gets the table style. NOTE: This always returns the table style as set.

getTitle()
Gets the table title/label

getType() Returns: {string}
Get descriptive string representing the type of control

getWidth() Returns: {string}
Get configured width for section (including unit)

Inherited hide(collapseFlag)
Hide the view.
Example

hideColumns(columns)
Hides the specified columns. For example [1,3,4] will hide the first, third and fourth columns.

Inherited isBound() Returns: {boolean}
Indicate the bound status of the view.

Inherited isEnabled() Returns: {boolean}
Check whether the view is enabled.
Example

Inherited isLabelVisible() Returns: {boolean}
Check whether the view label is visible.
Example

isRecordSelected(record, asInTable) Returns: {boolean}
Returns whether a particular record is selected

Inherited isVisible() Returns: {boolean}
Check whether the view is visible.
Example

Inherited propagateUpValueChange(event) Returns: {boolean}
Propagate the value change of the view up through the parent views.
Example

refresh(fetchNewData)
Refreshes the table, takes in a parameter indicating whether to fetch new data from the service.

removeRecord(record, asInTable) Returns: {boolean}
Remove the specified table record. Not in Service Data Table

search(col, exp, caseInsensitive, [useRegex])
Retrieves record according to the specified parameters -- alias to filter() method
Example

setAllRecordsSelected(selected, asInTable)
Selects or unselects records

setColorStyle(style)
Sets color style of table. NOTE: to avoid ambiguity always set the color using "D"|"L"|P"|"I"|"S"|"W"|"G"

setColumnLabel(index, label)
Changes the label of the specified columns. For example setColumnLabel(1, "Name") will change the label of the first column to "Name". Note: If the "selectionMode" of the table changes after this method is called, the header changes will be reverted and will need to be re-applied.

setColumns(columnSpecs)
Sets column specifications for the Service Data Table (results in complete table reset if the table had loaded records)
Example

setDefaultPageSize(defaultPageSize)
Sets the default page size range

Inherited setEnabled(enabled, required)
Enable or disable the view.
Example

setHeaderFooterStyle(style)
Sets the header foot style for the table

setHeadersVisibility(boolList, collapseHeader)
Sets the visibility of the table headers based on the boolList argument passed

setHelpText(helptext)
Set help text for Table control

setHighlightSelection(highlight)
This sets whether a row is highlighted when selected. Not in Service Data Tables

Inherited setLabelVisible(visible)
Show or hide the view label.
Example

setPageIndex(idx)
Set the page index, 0-based indexing

setPageSize(size)
Set the page size, number of rows in a given page

setPageSizeRange(minSize, maxSize)
Sets the page size range

setQueryData(data)
Sets the input for the AJAX Data Service. Service Data Tables only

setRecordSelected(record, selected, asInTable)
Select or clear the record

setSortCriteria(col, [asc], use)
Sets the predefined column sort criteria when sort() is called without parameters

setTableStyle(style)
This programmatically sets the table style. NOTE: No error checking.

setTitle(null)
Programmatically sets the table title/label in the table's header

Inherited setViewData(data, createPseudoBinding)
Set or update the bound data associated with the view. It applies only to views with bound data.

Note: It should only be used with simple type bindings, or complex type bindings with simple type properties.
It should not be used with bindings that have properties that are lists or compext types. For complex types, set the bindings by using
the binding.set pattern, as described in the Binding data and configuration options documentation section.
Example

Inherited setVisible(visible, collapse)
Show or hide the view.
Examples

setWidth(width)
Set width of table (e.g. 50px, 20%, 2em - omitting the unit assumes px)

Inherited show()
Show this view.
Example

showColumns(columns)
Shows the specified columns (if they were previously hidden). For example [1,3,4] will show the first, third and fourth columns.

showPager(show)
Shows or hides the pager(pagination) at the bottom of the table

sort(col, [asc], use)
Sort by column and whether it should be in ascending order

Inherited triggerFormulaUpdates([phase])
Broadcast the expression trigger for the specified view.
Example