MultiRecord CSL
These CSL functions will affect MultiRecord components.
Namespace | multiRecord |
---|
Common
The following functions are common functions for a MultiRecord.
Progress
Sets the progress of the MultiRecord.
Syntax
CSL.multiRecord.progress(progress?, multiRecordViewId?);
Parameters
Name | Type | Description |
---|---|---|
progress? | boolean | Whether to set the MultiRecord in progress. If not specified, sets the MultiRecord in progress. |
multirecordViewId? | string | The id of the MultiRecord view. If not specified, the component from which the function is called will be used. |
Example
// Set in progress and out of progress 1.5 second later.
CSL.multiRecord.progress(true);
setTimeout(() => {
CSL.multiRecord.progress(false);
}, 1500)
Selection
The following functions have an effect on the selection of a MultiRecord.
Select
Selects a record in the Multirecord.
Syntax
CSL.multiRecord.select(rowKey, multiRecordviewId?);
Parameters
Name | Type | Description |
---|---|---|
rowKey | string | Array<string> | The key(s) of the record(s) you want to select. |
multirecordViewId? | string | The id of the MultiRecord view. If not specified, the component from which the function is called will be used. |
Example
CSL.multiRecord.select('1151');
CSL.multiRecord.select(['1151', '1152']);
Deselect
Deselects a record in the Multirecord.
Syntax
CSL.multiRecord.deselect(rowKey, multiRecordviewId?);
Parameters
Name | Type | Description |
---|---|---|
rowKey | string | Array<string> | The key(s) of the record(s) you want to deselect. |
multirecordViewId? | string | The id of the MultiRecord view. If not specified, the component from which the function is called will be used. |
Example
CSL.multiRecord.deselect('1151');
CSL.multiRecord.deselect(['1151', '1152']);
Select all
Selects all records in the Multirecord.
Syntax
CSL.multiRecord.selectAll(multiRecordviewId?);
Parameters
Name | Type | Description |
---|---|---|
multirecordViewId? | string | The id of the MultiRecord view. If not specified, the component from which the function is called will be used. |
Example
CSL.multiRecord.selectAll();
Deselect all
Deselects all records in the Multirecord.
Syntax
CSL.multiRecord.deselectAll(multiRecordviewId?);
Parameters
Name | Type | Description |
---|---|---|
multirecordViewId? | string | The id of the MultiRecord view. If not specified, the component from which the function is called will be used. |
Example
CSL.multiRecord.deselectAll();
Get selected items
Returns all the selected records in the Multirecord.
Syntax
CSL.multiRecord.getSelectedItems(multiRecordviewId?);
Parameters
Name | Type | Description |
---|---|---|
multirecordViewId? | string | The id of the MultiRecord view. If not specified, the component from which the function is called will be used. |
Example
let selectedItems = CSL.multiRecord.getSelectedItems();
List item function
The following functions handle execution of list item functions configured on the grid.
Delete record
Executes the Delete function configured on the Multirecord view based on the record found for the given rowKey.
Syntax
CSL.multiRecord.deleteRecord(rowKey, multiRecordviewId?);
Parameters
Name | Type | Description |
---|---|---|
rowKey | string | The key of the record you want to delete. |
multirecordViewId? | string | The id of the MultiRecord view. If not specified, the component from which the function is called will be used. |
Example
CSL.multiRecord.deleteRecord('1151');
Execute function
Executes a list item function from the grid.
Syntax
CSL.multiRecord.executeFunction(rowKey, dataItems, multiRecordviewId?, forceExecution = false);
Parameters
Name | Type | Description |
---|---|---|
functionName | string | The name of the function that needs to be executed. |
dataItems | Array<object> | The data items to send with the function. |
multirecordviewId? | string | The id of the multiRecord view. If not specified, the component from which the function is called wil be used. |
forceExecution | boolean | When true, the function will be executed, even when confirmation is enabled. Default false |
Example
CSL.multiRecord.executeFunction('AddToStock', [{productName: 'AB1551E', vendor: 'Pursuit'}, {productName: 'GGHF78', vendor: 'Gulvan'}], null, true);
Export
Executes the export function for the MultiRecord.
Syntax
CSL.multiRecord.export(multiRecordviewId?);
Parameters
Name | Type | Description |
---|---|---|
multirecordviewId? | string | The id of the MultiRecord view. If not specified, the component from which the function is called will be used. |
Example
CSL.multiRecord.export();
Styling
The following functions have an effect on the styling of a MultiRecord.
Record styling
Sets the styling on the entire record.
Syntax
CSL.multiRecord.setRecordStyling(styling);
Parameters
Name | Type | Description |
---|---|---|
styling | StylingObject | The styling to set. |
Conditional data
The condition function receives the data of the record.
Static example
Conditional example
Record group styling
Sets the styling of each record group header.
Syntax
CSL.multiRecord.setRecordGroupStyling(styling)
Parameters
Name | Type | Description |
---|---|---|
styling | StylingObject | The styling to set. |
Conditional data
The condition function receives the data of all the records within the group.
Static example
Conditional example
Field styling
Sets the styling of a field in a record. This is executed for each record, allowing different styles for different records.
Syntax
CSL.multiRecord.setFieldStyling(styling, fieldNames)
Parameters
Name | Type | Description |
---|---|---|
styling | StylingObject | The styling to set. |
fieldNames | string | Array<string> | A string or array of strings indicating the names of the fields that the styling should be applied to. |
Conditional data
The condition function receives the data of the current record.
Static example
Conditional example
Header styling
Sets the styling of one or more headers.
Syntax
CSL.multiRecord.setHeaderStyling(styling, fieldNames)
Parameters
Name | Type | Description |
---|---|---|
styling | StylingObject | The styling to set |
fieldNames | string | Array<string> | A string or array of strings indicating the names of the fields that the styling should be applied to. |
Conditional data
The condition function receives the full data set of the current page.
Static example
Conditional example
Data
The following functions have an effect on the data of a MultiRecord.
Get cell value
Returns the value of a specific cell in the MultiRecord.
Syntax
CSL.multiRecord.getCellValue(rowKey, viewFieldName, multiRecordViewId?);
Parameters
Name | Type | Description |
---|---|---|
rowKey | string | The key of the record on which the cell can be found. |
viewFieldName | string | The name of the field you want to get the value for. |
multirecordViewId? | string | The id of the MultiRecord view. If not specified, the component from which the function is called will be used. |
Example
CSL.multiRecord.getCellValue('1151', 'productName');
Set cell value
Sets the value of cell of a specific value in the multiRecord.
Syntax
CSL.multiRecord.setCellValue(rowKey, viewFieldName, value, multiRecordViewId?);
Parameters
Name | Type | Description |
---|---|---|
rowKey | string | The key of the record on which the cell can be found. |
viewFieldName | string | The name of the field you want to get the value for. |
value | any | The value to set |
multirecordViewId? | string | The id of the MultiRecord view. If not specified, the component from which the function is called will be used. |
Example
let pageData = CSL.multiRecord.setCellValue('11143', 'productName', 'AE95E3');
Get column values
Returns an array of unique values found in the column.
Syntax
CSL.multiRecord.getColumnValues(viewFieldName, multiRecordViewId?);
Parameters
Name | Type | Description |
---|---|---|
viewFieldName | string | The name of the field you want to get the value for. |
multirecordViewId? | string | The id of the MultiRecord view. If not specified, the component from which the function is called will be used. |
Example
let stockValues = CSL.multiRecord.getColumnValues('stock');
Get page data
Returns an array of all records found in the MultiRecord.
Syntax
CSL.multiRecord.getPageData(multiRecordViewId?);
Parameters
Name | Type | Description |
---|---|---|
multirecordViewId? | string | The id of the MultiRecord view. If not specified, the component from which the function is called will be used. |
Example
let pageData = CSL.multiRecord.getPageData();