new ServiceDataTable()
This constructor is never used explicitly.
Extends
Members
Methods
-
inherited addClass(name, replaced)
-
Add/replace CSS class(es) for this control
Name Type Description name
string CSS class name(s) to add to the control. Separate class names by a space if more than one class. replaced
string optional CSS class name(s) to be replaced by the first argument. Separate class names by a space if more than one class. Example
Button.addClass("green");
-
appendElement(obj)
-
Adds the specified element to the table -- appendRecord() and add() are aliases to this method.
Name Type Description obj
object The element to be added Examples
${Table}.appendElement({}); //to create a new empty row
${Table}.appendElement({"str1":"strVal", "int1": 3}); //new row with data
-
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()
Name Type Description objs
Array.<object> The element/record to be added Example
${Table}.appendElements([{"str1":"strVal", "int1": 3}, {"str1":"strVal2", "int1": 4}]); //new row with data
-
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(){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"
Returns:
Type Description string -
getColumns(){object}
-
Gets column specifications for the Service Data Table
Returns:
Type Description object columnSpecs The specifications for the columns (are not to be modified) -
getFilteredRecords(col, exp, caseInsensitive, useRegex){Array.<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
Name Type Description col
any When the type is "number" this is the column to be searched or null for all columns. When type is "string" this is the property name in the table to be searched. When the type is "function" this is the comparator function to use for the search. Note that when the type is function, the other parameters are ignored. exp
string regular expression or string to use for the search depending on useRegex caseInsensitive
boolean whether the search should be case insensitive useRegex
boolean optional whether or not to use the regular expression set Returns:
Type Description Array.<Object> -
getHighlightSelection(){boolean}
-
This returns whether a row is highlighted when selected. Not in Service Data Tables
Returns:
Type Description boolean -
getMaxPageIndex(){integer}
-
Get the maximum page index
Returns:
Type Description integer -
getPageIndex(){integer}
-
Returns the page index
Returns:
Type Description integer -
getPageSize(index, actual){integer}
-
Returns the page size
Name Type Description index
integer (Optional) Index of page - if null, uses the current page actual
boolean If true, gets the actual page size (i.e. number of rows on the page) instead of the configured page size Returns:
Type Description integer -
getQueryData(){any}
-
Gets the input for the AJAX Data Service. Service Data Tables only.
Returns:
Type Description any -
getRecord(index, asInTable){Object}
-
Returns the record at the specific index
Name Type Description index
integer 0-based index/position of record asInTable
boolean If true, returns record as sorted and/or filtered in the table, if false or omitted returns the record unfiltered and according to the original order. Record indices with "asInTable" take sorting and filtering into account but are independent of whether the table is paging or not. Returns:
Type Description Object -
getRecordCount(asInTable){integer}
-
Returns the number of records in the table
Name Type Description asInTable
boolean If true, returns count of records filtered by search, if false or omitted returns the unfiltered record count. Record counts ith "asInTable" take sorting and filtering into account but are independent of whether the table is paging or not. Returns:
Type Description integer -
getRecordIndex(record, asInTable){integer}
-
Returns the record at the specific index
Name Type Description record
Object asInTable
boolean If true, returns the index of the record as sorted and/or filtered in the table, if false or omitted returns the index of the record unfiltered and according to the original order. Record indices with "asInTable" take sorting and filtering into account but are independent of whether the table is paging or not. Returns:
Type Description integer -
getRecordOnPage(recIdx, pageIdx){Object}
-
Returns the record at the index and page specified - respecting the sorting and filtering that may be active on the table.
Name Type Description recIdx
integer pageIdx
integer (Optional) If not specified, assumes current page Returns:
Type Description Object Or undefined if the page index and record index don't match an actual record in the table -
getRecords(asInTable){Array.<Object>}
-
Returns the record at the specific index
Name Type Description asInTable
boolean If true, returns records as sorted and/or filtered in the table, if false or omitted returns the records unfiltered and according to the original order. Record indices with "asInTable" take sorting and filtering into account but are independent of whether the table is paging or not. Returns:
Type Description Array.<Object> -
getRecordsOnPage(pageIdx){Array.<Object>}
-
Returns the records at page index specified - respecting the sorting and filtering that may be active on the table.
Name Type Description pageIdx
integer (Optional) If not specified, assumes current page Returns:
Type Description Array.<Object> -
getRowForView(v){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(
)]. Name Type Description v
object A view instance in the table (in one of the table cells) Returns:
Type Description Row The row object containing the view -
getSelectedIndex(asInTable){integer}
-
Returns the selected record (if any)
Name Type Description asInTable
boolean If true, returns the index of the selected record based on the current filtering and sort order of the table. If false or omitted returns the index of the selected record regardless of table filtering and based on the natural/original order of the records. Record indices with "asInTable" take sorting and filtering into account but are independent of whether the table is paging or not. Returns:
Type Description integer -
getSelectedIndices(asInTable){Array.<integer>}
-
Returns the selected records (if any) - Note that the indices array may not always be sorted in ascending order of indices
Name Type Description asInTable
boolean If true, returns the indices of the selected records based on the current filtering and sort order of the table. If false or omitted returns the index of the selected records regardless of table filtering and based on the natural/original order of the records. Record indices with "asInTable" take sorting and filtering into account but are independent of whether the table is paging or not. Returns:
Type Description Array.<integer> -
getSelectedRecord(asInTable){Object}
-
Returns the selected record (if any)
Name Type Description asInTable
boolean If true, returns the selected record (if any) from the records not filtered out in the table. If false or omitted returns the selected record (if any) regardless of table filtering. Records returned with "asInTable" take sorting and filtering into account but are independent of whether the table is paging or not. Returns:
Type Description Object -
getSelectedRecordCount(asInTable){integer}
-
Returns the selected record (if any)
Name Type Description asInTable
boolean If true, returns the count of selected records from the records not filtered out in the table. If false or omitted returns the count of selected record regardless of table filtering. Record counts with "asInTable" take sorting and filtering into account but are independent of whether the table is paging or not. Returns:
Type Description integer -
getSelectedRecords(asInTable){Array.<Object>}
-
Returns the selected record (if any)
Name Type Description asInTable
boolean If true, returns the selected records (if any) from the set of records not filtered out in the table. If false or omitted returns the selected records (if any) regardless of table filtering. Records returned with "asInTable" take sorting and filtering into account but are independent of whether the table is paging or not. Returns:
Type Description Array.<Object> -
getTableStyle(){string}
-
Gets the table style. NOTE: This always returns the table style as set.
Returns:
Type Description string -
getTitle(){string}
-
Gets the table title/label
Returns:
Type Description string -
getType(){string}
-
Get descriptive string representing the type of control
Returns:
Type Description string -
getWidth(){string}
-
Get configured width for section (including unit)
Returns:
Type Description string -
inherited hide(collapseFlag)
-
Hide this view/control
Name Type Description collapseFlag
boolean Set to true
to collapse the view (equivalent to a view setting of "NONE")Example
MyView.hide();
-
inherited isBound(){boolean}
-
Indicates bound status of control.
Returns:
Type Description boolean True if the control is bound to coach data. -
inherited isEnabled(){boolean}
-
Checks if the view is enabled or not
Returns:
Type Description boolean Enabled status Example
var enabled = MyView.isEnabled();
-
inherited isLabelVisible(){boolean}
-
Checks if control label is visible
Returns:
Type Description boolean Label visibility status Example
var labelVisible = MyView.isLabelVisible();
-
isRecordSelected(record, asInTable){boolean}
-
Returns whether a particular record is selected
Name Type Description record
integer | object the index of the record to be removed, or the record object itself asInTable
boolean (Only used with index) If true, checks the selected status of the record at the sorted and/or filtered index position, if false or omitted checks the selected status of the record at the index according to the original order and regardless of filtering. Returns:
Type Description boolean -
inherited isVisible(){boolean}
-
Checks whether or not view is visible
Returns:
Type Description boolean Visibility status Example
var visible = MyView.isVisible();
-
inherited propagateUpValueChange(event){boolean}
-
Propagates value change of control up through parent views
Name Type Description event
Event Value change event (usually an onchange event) Returns:
Type Description boolean True if a formula update was triggered on the control's parent, otherwise false Example
MyView.propagateUp(event);
-
refresh(fetchNewData)
-
Refreshes the table, takes in a parameter indicating whether to fetch new data from the service. Only works for tables that are populated by an AJAX service.
Name Type Description fetchNewData
boolean set true or false whether new data load on refresh -
removeRecord(record, asInTable){boolean}
-
Remove the specified table record. Not in Service Data Table
Name Type Description record
integer | object the index of the record to be removed, or the record object itself asInTable
boolean (Only used with index) If true, removes the record at the sorted and/or filtered index position, if false or omitted removes the record at the index according to the original order. Record indices with "asInTable" take sorting and filtering into account but are independent of whether the table is paging or not. Returns:
Type Description boolean true if record successfully removed -
search(col, exp, caseInsensitive, useRegex)
-
Retrieves record according to the specified parameters -- alias to filter() method
Name Type Description col
any When the type is "number" this is the column to be searched or null for all columns. When type is "string" this is the property name in the table to be searched. When the type is "function" this is the comparator function to use for the search. Note that when the type is function, the other parameters are ignored. exp
string regular expression or string to use for the search depending on useRegex caseInsensitive
boolean whether the search should be case insensitive useRegex
boolean optional whether or not to use the regular expression set Example
me.search(0, "[0-9]", true, true)
-
setAllRecordsSelected(selected, asInTable)
-
Selects or unselects records
Name Type Description selected
boolean Flag to indicate whether to select or unselect the records asInTable
boolean (Only used with index) If true, sets the selected status of the records that are not filtered out, if false or omitted sets the selected status of all records regardless of filtering -
setColorStyle(style)
-
Sets color style of table. NOTE: to avoid ambiguity always set the color using "D"|"L"|P"|"I"|"S"|"W"|"G"
Name Type Description style
string "DEFAULT"|"DEF"|"D"=Default | "LIGHT"|"L"=Light | PRIMARY"|"P"=Primary | "INFO"|INF"|"I"=Info | "SUCCESS"|"S"=Success | "WARNING"|"WARN"|"W"=Warning | "ERROR"|"ERR"|"DANGER"|"G"=Danger -
setColumns(columnSpecs)
-
Sets column specifications for the Service Data Table (results in complete table reset if the table had loaded records)
Name Type Description columnSpecs
object The specifications for the columns Example
var table1 = page.ui.get("Table1");var columnSpecs = [ {width: "20%", visibility: true, sortable: true, cssClass: "", dataElementName: "str1", type: "Text", label: "Str1"}, {width: "25%", visibility: true, sortable: true, cssClass: "", dataElementName: "int1", type: "Integer", label: "Int1"}, {width: "25%", visibility: true, sortable: true, cssClass: "", dataElementName: "dec1", type: "Decimal", label: "Dec1", options:{decimalPlaces: 2, prefix: "$", thousandSeparator: ","}}, {width: "30%", visibility: true, sortable: false, cssClass: "", dataElementName: "date1", type: "Date", label: "Date1", options:{dateFormat: "yyyy-MM"}},];table1.setColumns(columnSpecs);table1.refresh();
-
inherited setEnabled(enabled, required)
-
Enable/disable this view/control
Name Type Description enabled
boolean Enabled/read-only flag ( true
to enable view,false
to disable/make read-only)required
boolean Enable/disable required field flag for control Example
MyView.setEnabled(false); //Make MyView read-only
-
setHighlightSelection(highlight)
-
This sets whether a row is highlighted when selected. Not in Service Data Tables
Name Type Description highlight
boolean Set to true to enable selection highlights -
inherited setLabelVisible(visible)
-
Show/hide the label of this view/control
Name Type Description visible
boolean Label visibility flag ( true
to show view label,false
to hide)Example
MyView.setLabelVisible(false);
-
setPageIndex(idx)
-
Set the page index, 0-based indexing
Name Type Description idx
integer the page index -
setPageSize(size)
-
Set the page size, number of rows in a given page
Name Type Description size
integer the page size -
setQueryData(data)
-
Sets the input for the AJAX Data Service. Service Data Tables only
Name Type Description data
any set the query data -
setRecordSelected(record, selected, asInTable)
-
Returns whether a particular record is selected
Name Type Description record
integer | object the index of the record to be removed, or the record object itself selected
boolean Flag to indicate whether to select or unselect the record asInTable
boolean (Only used with index) If true, sets the selected status of the record at the sorted and/or filtered index position, if false or omitted sets the selected status of the record at the index according to the original order and regardless of filtering -
setTableStyle(style)
-
This programmatically sets the table style. NOTE: No error checking.
Name Type Description style
string "D"=Default | "E"=Elegant | "B"=table-bordered | "S"=table-striped | "H"=table-hover | "C"=table-condensed -
setTitle(title)
-
Programmatically sets the table title/label in the table's header
Name Type Description title
string -
inherited setVisible(visible, collapse)
-
Show/hide this view/control
Name Type Description visible
boolean Visibility flag ( true
to show view,false
to hide)collapse
boolean Set to true
to collapse the control space whenvisible
is set tofalse
.Examples
MyView.setVisible(false, false); //Equivalent to MyView.hide()
MyView.setVisible(false, true); // Sets visibility to "None"
-
setWidth(width)
-
Set width of table (e.g. 50px, 20%, 2em - omitting the unit assumes px)
Name Type Description width
string sets the width -
Show this view/control
Example
MyView.show();
-
sort(col, asc, use)
-
Sort by column and whether it should be in ascending order
Name Type Description col
string the column name asc
boolean optional ascending order, default is false use
boolean sort value that was specified at cell render time using cell.setSortValue() instead of simply using the displayed text -
inherited triggerFormulaUpdates(phase)
-
Broadcasts the expression trigger for the specified view
Name Type Default Description phase
int bpmext.ui.PHASE_NORMAL optional The phase we are currently in Example
MyView.triggerFormulaUpdates();