cpr.data.DataSet

DataSet.
A data object that has real data in a two-dimensional array.
Data filters, sorting, and provides APIs such as retrieving data and fetching conditional values.
Hierarchy

Index

Events
Event Description
before-delete An event raised before a row is deleted.
before-insert An event that occurs before a row is added.
before-update An event that occurs when the data is modified.
clear An event that occurs when data information is removed.
delete Event that occurs when a row is deleted.
filter Event that occurs when data is filtered.
insert Events that occur when rows are added.
load An event that occurs when the data structure is reconstructed by the build method.
sort An event that occurs when the data is sorted.
update An event that occurs when data is modified.
Properties
Name Type Description
alterColumnLayout String Returns the column structure change criteria when the data structure is reorganized by build.
disposed Boolean Returns whether the control should be removed.
id String Returns the ID of the control.
info String Returns the dataset information value.
stateRestore Boolean Returns whether to restore the state value by value.
type ControlType Returns the signature string of the Control's unique Type that can distinguish the Control.
uuid String Returns the unique ID of the control.
Methods
Name Return Type Description
addColumn Boolean Add Column.
addDisplayColumn Boolean Add Display Column
addEventListener Add listeners by EventType to the control.
addEventListenerOnce (e: cpr.events.CEvent)=>Void Add a listener to the control that will run only once per EventType.
addRow IDataRow Add a new row at the end.
addRowData IDataRow Enter rowData and add a new row at the end.
bind IBindFactory Bind that property.
bindParentRow Bind the line of the parent dataset.
bindParentRowId Bind it with the line ID of the parent dataset.
build Number Configure the DataSet via json data.
changeRowIndex Replace the position of two rows.
clear Removes data set information.
clearData Remove all rows in the dataset.
clearFilter Remove the filtering condition.
clearSort Remove the sort condition.
commit Allows you to remember the changed state of the current view in its original state.
copyToDataMap Boolean Copies data from the current dataset to the target datamap.
copyToDataSet Boolean Copy data from the current dataset to the target dataset
deleteColumn Boolean Delete the Column.
deleteRow Boolean Get the row index and remove the row.
dispatchEvent Boolean Forwards specific events.
dispose Removes the objects contained in the control.
findAllRow IDataRow[] Returns an array of all the Row objects in the specified range that satisfy the condition.
findAllRowBoundlessly IDataRow[] Among all data rows ignoring bindParentRow and filter, rows that match the condition are returned as an array of cpr.data.DataRow objects.
findAllRowExpr IDataRow[] Returns an array of all the Row objects in the specified range that satisfy the condition.
findAllRowExprBoundlessly IDataRow[] Among all data rows ignoring bindParentRow and filter, rows that match the condition are returned as an array of cpr.data.DataRow objects.
findFirstRow IDataRow Returns the first Row object in the specified range that meets the condition.
findFirstRowBoundlessly IDataRow Returns the first cpr.data.DataRow object that matches the condition among all data rows ignoring bindParentRow and filter.
findFirstRowExpr IDataRow Returns the first Row object in the specified range that meets the condition.
findFirstRowExprBoundlessly IDataRow Returns the first cpr.data.DataRow object that matches the condition among all data rows ignoring bindParentRow and filter.
findParentRow IDataRow Returns the line of the parent dataset corresponding to the input line ID.
findParentRowBoundlessly IDataRow BindparRENTROW and all data rows that ignore bindparRENTROW and Filters return CPR.Data.datarow objects with a matching row ID.
findUnfilteredFirstRow IDataRow Returns the first cpr.data.DataRow object that matches the condition regardless of the filter.
findUnfilteredFirstRowExpr IDataRow Returns the first cpr.data.DataRow object that matches the condition regardless of the filter.
forEachOfUnfilteredRows Process data row by row for the entire data.
getAppInstance AppInstance Returns the app instance to which the control belongs.
getAvg DecimalType Returns the average of the data in the input column name.
getBindContext BindContext Returns the bind context.
getBindInfo BindInfo Returns the bind property information for the control.
getBindedParentRowId String Returns the row ID of the linked parent dataset.
getBoolean Boolean Returns the Boolean data corresponding to the input rowIndex and columnName.
getColumn Column Returns the Column object for that column name.
getColumnCount Number Returns the number of columns.
getColumnData Array Returns the data of the column corresponding to the input columnName as an array type.
getColumnNames String[] Returns the column name in array format.
getConditionalAvg DecimalType Returns the average of the data in the input column name of the row that satisfies the condition.
getConditionalAvgExpr DecimalType Returns the average of the data of the column names received among the rows that meet the conditions.
getConditionalMax Object Returns the maximum value of the column name data among the rows that meet the conditions.
getConditionalMaxExpr Object Returns the maximum value of the column name data among the rows that meet the conditions.
getConditionalMin Object Returns the minimum value of the column name data among the rows that meet the conditions.
getConditionalMinExpr Object Returns the minimum value of the column name data among the rows that meet the conditions.
getConditionalRowCount Number Returns the number of rows that match the condition.
getConditionalRowCountExpr Number Returns the number of rows that match the condition.
getConditionalSum DecimalType Returns the sum of the column name data among the rows that meet the conditions.
getConditionalSumExpr DecimalType Returns the sum of the data of the input column name of the row that satisfies the condition.
getFilter #expression Returns the currently filtered condition.
getFilterExpr Expression Returns the currently filtered condition.
getHeader Header Returns the Header object through the column name.
getHeaders Header[] Returns the headers of the corresponding HeaderType as an array.
getMax Object Returns the maximum value among the data of the input column name.
getMin Object Returns the minimum value among the data of the input column name.
getNumber Number Returns the data corresponding to the input rowIndex and columnName as a Number.
getOriginalAvg DecimalType Returns the average of the source data of the column names entered.
getOriginalMax Object Returns the maximum value of the original data of the column name received.
getOriginalMin Object Returns the minimum value of the original data of the column name received.
getOriginalRowCount Number Returns the number of rows in the source data.
getOriginalSum DecimalType Returns the sum of the source data of the input column name.
getOriginalValue Object Returns the original data corresponding to the input rowindex and columnName.
getRow IDataRow Returns the Row object at the row index.
getRowCount Number Returns the current number of rows.
getRowCountByState {[key:number]: Number} Returns the number of rows with the corresponding status value by state.
getRowData RowConfigInfo Returns the row data of the input row index in the format {columnName: value}.
getRowDataRanged RowConfigInfo[] Returns an array of row data corresponding to the input range.
getRowDatasByState {[key:number]: cpr.data.RowConfigInfo[]} Returns an array of row data with the corresponding status values.
getRowIndicesByState {[key:number]: Number[]} Search the row with the corresponding status value and use the status value as the key value Returns a json object whose value is the row index array.
getRowState RowState View the status values ​​of a specific row
getRowStateString String Returns the state value of a specific row as a string type.
getRowStatedCount Number Returns the number of rows with the corresponding status value.
getRowStatedIndex Number Retrieves the row with the corresponding status value and returns the row index.
getRowStatedIndices Number[] Retrieves a row with the corresponding status value and returns an array of row indices.
getRowsAttr String[] Returns an array of the attribute values ​​of the attribute name in all rows.
getSort #expression Returns the current sorting condition.
getSortExpr Expression Returns the current sorting condition.
getString String Returns the data corresponding to the input rowIndex and columnName as a String.
getSum DecimalType Returns the sum of the data of the input column name.
getUnfilteredDistinctValues Array Returns an array of non-overlapping values ​​of a specific column in the entire data.
getUnfilteredRowCount Number Returns the number of rows corresponding to a specific filter value in the entire data.
getUnfilteredRowDatas RowConfigInfo[] Returns an array of row data corresponding to a specific filter value in the entire data.
getUnfilteredRowDatasByState {[key:number]: cpr.data.RowConfigInfo[]} Returns an array of row data with the corresponding status value from the entire data.
getUserAttrNames String[] Returns all custom attribute names.
getValue Object Returns the data corresponding to the input Rowindex and ColumnName.
insertRow IDataRow Add a new row before or after the desired row index.
insertRowData IDataRow Enter rowData and add a new row before or after the desired row index.
isAvailableBinding Boolean Returns whether the queried property is bindable and the binding has been configured to obtain a valid value.
isBindable Boolean Make sure it is a bindable property.
isDisplayColumn Boolean Returns whether this column name is Display Column.
isExistColumn Boolean Returns whether this column name exists.
isModified Boolean Returns whether the dataset has changed
moveRowIndex Converts the row at sourceIndex to targetIndex.
parseData Sets data set initial property, column information, and row data information.
pushRow IDataRow Add a new row at the end.
pushRowData IDataRow Enter rowData and add a new row at the end.
pushRowSilently IDataRow At the end, a new row connected to the parent dataset is added with the data.
putValue Boolean Change the value of the input rowIndex and columnName to only the value without changing the row state.
realDeleteRow Boolean Enter the row index and completely remove the row.
refresh Reconstruct view data based on source data
removeAllEventListeners Removes all event listeners for the control.
removeAllUserAttr Delete all custom attributes.
removeEventListener Remove Listener for each EventType in the control.
removeEventListeners Remove all EventType listeners from the control.
removeUserAttr Removes user-defined attributes for a specific attribute name.
resetCondition The sort and filter applied to the dataset will be initialized.
revert Revert to last commit state
revertRow Only the data at a specific row index is rounded.
setFilter Filter view data by specifying filtering criteria
setFilterExpr Filter view data by specifying filtering criteria
setRowState Changes the state value of a specific row.
setRowStateAll Change the status value of the entire row to the input status value.
setRowStateRanged Changes the status value of the input row range to the input status value.
setRowsAttr Batch modifies the attribute values ​​of the attribute names in all rows.
setSort Sort the view data by specifying the sort condition.
setSortExpr Sort the view data by specifying the sort condition.
setUnfilteredRowStateAll Change the status value of all data to the received status value.
setValue Boolean Correct the data corresponding to the received rowIndex and columnName.
unbind Unbind that property.
updateRow Boolean It takes data in the format {columnName: value} and makes a complete change to the data in a particular row.
userAttr Specifies custom properties.
userData Specifies custom data.
userattr Object Returns a user-defined property.

Constructor

DataSet(id)
Parameters
name type description
id String Returns the ID of the control.

Events

before-delete
CDataEvent An event raised before a row is deleted.
Occurrence method: deleteRow, realDeleteRow
row: {cpr.data.Row} Row object to be deleted
before-insert
CDataEvent An event that occurs before a row is added.
Method of occurrence: addRow, addRowData, insertRow, insertRowData
before-update
CDataEvent An event that occurs when the data is modified.
Method of occurrence: setValue, updateRow
 row: {cpr.data.Row} Row object of the data to be modified 
 columnName: {string} Column name of the data to be modified 
 beforeValue: {any} the previous value of the cell you want to modify 
 currentValue: {string} current value 
clear
CDataEvent An event that occurs when data information is removed.
Occurrence method: clear, (specific condition) build
When using the build method, an event occurs when the parameter isAdd=false or DataSet.alterColumnLayout="server".
delete
CDataEvent Event that occurs when a row is deleted.
Method of occurrence: deleteRow, realDeleteRow
 row: {cpr.data.Row} deleted row object 
filter
CDataEvent Event that occurs when data is filtered.
Methods of occurrence: setFilter, setFilterExpr, clearFilter
insert
CDataEvent Events that occur when rows are added.
Methods of occurrence: addRow, addRowData, insertRow, insertRowData
 row: {cpr.data.Row} Added row object 
load
CDataEvent An event that occurs when the data structure is reconstructed by the build method.
sort
CDataEvent An event that occurs when the data is sorted.
Methods of occurrence: setSort, setSortExpr, clearSort
update
CDataEvent An event that occurs when data is modified.
Methods of occurrence: setValue, updateRow
 row: {cpr.data.Row} The row object of the data you want to modify. 
 columnName: {string} The column name of the data you want to modify. 
 beforeValue: {any} The previous value of the cell you want to modify. 
 currentValue: {string} current value 

Properties

alterColumnLayout
type String
get
Returns the column structure change criteria when the data structure is reorganized by build.
set
Set the column structure change criteria when the data structure is rebuilt by build.
If you enter an invalid value, it defaults to "client".
disposed
declaring type Control
type Boolean
readonly
Returns whether the control should be removed.
id
declaring type Control
type String
readonly
Returns the ID of the control.
info
type String
get
Returns the dataset information value.
set
Sets the dataset information value.
stateRestore
type Boolean
get
Returns whether to restore the state value by value.
set
Set whether to restore the state value by value.
[true]: If the current value is the same as the original value, the status value is restored.
[false]: The existing value is maintained even if it is the same as the original value. (default)
type
declaring type Control
type ControlType
readonly
Returns the signature string of the Control's unique Type that can distinguish the Control. Please refer to ControlType for available constant values. For UDC controls, each unique type name is returned. Example: udc.MyUDC
uuid
declaring type Control
type String
readonly
Returns the unique ID of the control.

Methods

addColumn(column)
Add Column.

UPDATED event occurs when a value is added to a column added with addColumn.
Parameters
name type description
column Header
return Boolean Whether the column was successfully added.
addDisplayColumn(column)
Add Display Column

Header information is added, and if there is data, corresponding column data is also added to row data.

Columns added with addDisplayColumn will not change the row state or UPDATED event when modifying the value.
Column that does not participate in Row state change and is not transmitted as request data even in submission communication.
Parameters
name type description
column Header
return Boolean Whether the column was successfully added.
addEventListener(type, listener)
declaring typeControl
Add listeners by EventType to the control.
Add a listener to the control to handle when a specific event occurs.
var button = new cpr.controls.Button("btn01");
button.addEventListener("click", function(e) {
// event code...
});
Parameters
name type description
type String Event type.
listener (e: cpr.events.CEvent)=>Void Event listeners.
addEventListenerOnce(type, listener)
declaring typeControl
Add a listener to the control that will run only once per EventType.
Add a listener to the control to handle when a specific event occurs. The added listener is automatically deleted after running once. Since the object of the added listener is changed, when the listener is deleted It is an object returned after calling addEventListenerOnce and can be deleted.
var button = new cpr.controls.Button("btn01");
button.addEventListenerOnce("click", function(e) {
// event code...
});
Parameters
name type description
type String Event type.
listener (e: cpr.events.CEvent)=>Void Event listeners.
return (e: cpr.events.CEvent)=>Void The modified Listener object.
addRow()
Add a new row at the end.
An INSERTED event occurs.
return IDataRow The new Row object you added.
addRowData(rowData)
Enter rowData and add a new row at the end.
An INSERTED event occurs.
Parameters
name type description
rowData RowConfigInfo
return IDataRow The new Row object you added.
bind(propertyName)
declaring typeControl
Bind that property.
Parameters
name type description
propertyName #bindable-property_name The attribute name to bind.
return IBindFactory Factory showing bind type.
bindParentRow(row)
Bind the line of the parent dataset.
Parameters
name type description
row IDataRow
bindParentRowId(rowId)
Bind it with the line ID of the parent dataset.
Parameters
name type description
rowId String
build(data, isAdd)
Configure the DataSet via json data.
Parameters
name type description
data RowConfigInfo[] Data array to compose.
{[columnName: string]: string | number} []
isAddoptional Boolean defaultfalse Whether to keep existing data.
true: Keep existing data and add new data.
false(default): Remove existing data and add new data.
return Number Added row count.
changeRowIndex(sourceIndex, targetIndex)
Replace the position of two rows.
Parameters
name type description
sourceIndex Number
targetIndex Number
clear(all)
Removes data set information.
Parameters
name type description
alloptional Boolean defaultfalse Whether or not to remove all information.
true: Remove all attributes, column information, data, sort, and filter.
false(default) : Remove data, sort, filter.
clearData(emitEvent)
Remove all rows in the dataset.
Parameters
name type description
emitEventoptional Boolean defaulttrue
clearFilter()
Remove the filtering condition.
clearSort()
Remove the sort condition.
commit()
Allows you to remember the changed state of the current view in its original state.

1. Only changes to the Row state are made, The row index changed by sort / filter is not saved.
2. Display Column is not updated as original.
3. Change status
UNCHANGED: No change.
INSERTED, UPDATED: Change current value to Row with UNCHANGED state as original value
DELETED, INSERTDELETED: Deleted from source data.
copyToDataMap(targetDataMap, rowIndex)
Copies data from the current dataset to the target datamap.
Only the data in the existing columns of the target dataset is copied.
Parameters
name type description
targetDataMap DataMap
rowIndex Number
return Boolean
copyToDataSet(targetDataSet, filterCondition)
Copy data from the current dataset to the target dataset
Only the data in the existing columns of the target dataset is copied.
The data added during copying is INSERT state.
Parameters
name type description
targetDataSet DataCollection
filterConditionoptional #expression
return Boolean
deleteColumn(columnName)
Delete the Column. (Including Display column)
Parameters
name type description
columnName #column
return Boolean Whether the column was successfully deleted.
deleteRow(rowIndex)
Get the row index and remove the row.
DELETED event is fired.
Parameters
name type description
rowIndex Number
return Boolean Successful deletion of rows.
dispatchEvent(e)
declaring typeControl
Forwards specific events.
Parameters
name type description
e CEvent event
return Boolean Successful event delivery.
dispose()
declaring typeControl
Removes the objects contained in the control.
findAllRow(condition, startIndex, endIndex)
Returns an array of all the Row objects in the specified range that satisfy the condition.
※ We look by reference. (Search based on the current data)
Parameters
name type description
condition #expression
startIndexoptional Number default0
endIndexoptional Number default(this.getRowCount() - 1)
return IDataRow[] An array of Row objects that match the search criteria.
findAllRowBoundlessly(condition)
Among all data rows ignoring bindParentRow and filter, rows that match the condition are returned as an array of cpr.data.DataRow objects.
The returned cpr.data.DataRow object may return an invalid RowIndex if the row is hidden.
Parameters
name type description
condition #expression
return IDataRow[]
findAllRowExpr(condition, startIndex, endIndex)
Returns an array of all the Row objects in the specified range that satisfy the condition.
※ We look by reference. (Search based on the current data)
Parameters
name type description
condition Expression
startIndexoptional Number default0
endIndexoptional Number default(this.getRowCount() - 1)
return IDataRow[] An array of Row objects that match the search criteria.
findAllRowExprBoundlessly(condition)
Among all data rows ignoring bindParentRow and filter, rows that match the condition are returned as an array of cpr.data.DataRow objects.
The returned cpr.data.DataRow object may return an invalid RowIndex if the row is hidden.
Parameters
name type description
condition Expression
return IDataRow[]
findFirstRow(condition, startIndex, endIndex)
Returns the first Row object in the specified range that meets the condition.
※ Search by reference. (Search based on the current data)
Parameters
name type description
condition #expression
startIndexoptional Number default0
endIndexoptional Number default(this.getRowCount() - 1)
return IDataRow The Row object of the first row that satisfies the search condition.
findFirstRowBoundlessly(condition)
Returns the first cpr.data.DataRow object that matches the condition among all data rows ignoring bindParentRow and filter.
The returned cpr.data.DataRow object may return an invalid RowIndex if it is a hidden row.
Parameters
name type description
condition #expression
return IDataRow
findFirstRowExpr(condition, startIndex, endIndex)
Returns the first Row object in the specified range that meets the condition.
※ Search by reference. (Search based on the current data)
Parameters
name type description
condition Expression
startIndexoptional Number default0
endIndexoptional Number default(this.getRowCount() - 1)
return IDataRow The Row object of the first row that satisfies the search condition.
findFirstRowExprBoundlessly(condition)
Returns the first cpr.data.DataRow object that matches the condition among all data rows ignoring bindParentRow and filter.
The returned cpr.data.DataRow object may return an invalid RowIndex if it is a hidden row.
Parameters
name type description
condition Expression
return IDataRow
findParentRow(rowID)
Returns the line of the parent dataset corresponding to the input line ID.
This method returns the correct value only if the parent row ID is bound with 'BindparRENTROWID'.
Parameters
name type description
rowID String
return IDataRow Row object that matches the row ID
findParentRowBoundlessly(rowID)
BindparRENTROW and all data rows that ignore bindparRENTROW and Filters return CPR.Data.datarow objects with a matching row ID.
The returned CPR.DATA.DATAROW object can return rowindex that is not valid for hidden rows.
Getbindedparentrowid functions of Dataset/DataView binded by the bindparRENTROW function.
Parameters
name type description
rowID String
return IDataRow
findUnfilteredFirstRow(condition)
Returns the first cpr.data.DataRow object that matches the condition regardless of the filter.
The returned cpr.data.DataRow object may return an invalid RowIndex if it is a hidden row.
Parameters
name type description
condition #expression
return IDataRow
findUnfilteredFirstRowExpr(condition)
Returns the first cpr.data.DataRow object that matches the condition regardless of the filter.
The returned cpr.data.DataRow object may return an invalid RowIndex if it is a hidden row.
Parameters
name type description
condition Expression
return IDataRow
forEachOfUnfilteredRows(processFnc)
Process data row by row for the entire data.
(Total data means all data that has not been filtered.)
Parameters
name type description
processFnc (dataRow: cpr.data.IDataRow)=>Void
getAppInstance()
declaring typeControl
Returns the app instance to which the control belongs.
return AppInstance The app instance the control belongs to.
getAvg(columnName)
Returns the average of the data in the input column name.
It should only be used when the value of the corresponding column name is of type Number.
Parameters
name type description
columnName #column
return DecimalType The average of the values ​​in that column name.
getBindContext()
declaring typeControl
Returns the bind context.
return BindContext bind context
getBindInfo(propertyName)
declaring typeControl
Returns the bind property information for the control.
Parameters
name type description
propertyName #bindable-property_name The name of the attribute being bound.
return BindInfo BindInfo Properties
getBindedParentRowId()
Returns the row ID of the linked parent dataset.
return String Row ID of the parent dataset.
getBoolean(rowIndex, columnName)
Returns the Boolean data corresponding to the input rowIndex and columnName.
Parameters
name type description
rowIndex Number
columnName #column
return Boolean The Boolean type of the data.
getColumn(name)
Returns the Column object for that column name.
Parameters
name type description
name #column
return Column The Column object for the corresponding column.
getColumnCount()
Returns the number of columns.
return Number Number of columns.
getColumnData(columnName)
Returns the data of the column corresponding to the input columnName as an array type.
Parameters
name type description
columnName #column
return Array An array of all the data in the columnName.
getColumnNames(columnType)
Returns the column name in array format.
Parameters
name type description
columnTypeoptional HeaderType defaultheader.HeaderType.ALL
return String[] An array of column names.
getConditionalAvg(condition, columnName)
Returns the average of the data in the input column name of the row that satisfies the condition.
It should only be used if the value of the corresponding column name is a Number.
※ In the view base row, search for the row that satisfies the condition.
Parameters
name type description
condition #expression
columnName #column
return DecimalType The average of the data of the column name input among the rows that meet the condition.
getConditionalAvgExpr(condition, columnName)
Returns the average of the data of the column names received among the rows that meet the conditions.
It should be used only when the value of the column name is of type Number.

※ Search rows matching the criteria in the row based on the view.
Parameters
name type description
condition Expression
columnName #column
return DecimalType The average of the data of the column name input among the rows that meet the condition.
getConditionalMax(condition, columnName)
Returns the maximum value of the column name data among the rows that meet the conditions.
※ Search rows matching the criteria in the row based on the view.
Parameters
name type description
condition #expression
columnName #column
return Object The maximum value of the data of the input column among the rows that satisfy the condition.
getConditionalMaxExpr(condition, columnName)
Returns the maximum value of the column name data among the rows that meet the conditions.

※ Search rows matching the criteria in the row based on the view.
Parameters
name type description
condition Expression
columnName #column
return Object The maximum value of the data of the input column among the rows that satisfy the condition.
getConditionalMin(condition, columnName)
Returns the minimum value of the column name data among the rows that meet the conditions.
※ Search rows matching the criteria in the row based on the view.
Parameters
name type description
condition #expression
columnName #column
return Object The minimum value among the data of the input column name of the row that satisfies the condition.
getConditionalMinExpr(condition, columnName)
Returns the minimum value of the column name data among the rows that meet the conditions.

※ Search rows matching the criteria in the row based on the view.
Parameters
name type description
condition Expression
columnName #column
return Object The minimum value among the data of the input column name of the row that satisfies the condition.
getConditionalRowCount(condition)
Returns the number of rows that match the condition.
※ In the view base row, search for the row that satisfies the condition.
Parameters
name type description
condition #expression
return Number Number of rows matching the condition.
getConditionalRowCountExpr(condition)
Returns the number of rows that match the condition.
※ In the view base row, search for the row that satisfies the condition.
Parameters
name type description
condition Expression
return Number Number of rows matching the condition.
getConditionalSum(condition, columnName)
Returns the sum of the column name data among the rows that meet the conditions.
It should be used only when the value of the column name is of type Number.

※ Search rows matching the criteria in the row based on the view.
Parameters
name type description
condition #expression
columnName #column
return DecimalType Sum of data of input column name of Row matching condition.
getConditionalSumExpr(condition, columnName)
Returns the sum of the data of the input column name of the row that satisfies the condition.
It should only be used if the value of the corresponding column name is a Number.
※ In the view base row, search for the row that satisfies the condition.
Parameters
name type description
condition Expression
columnName #column
return DecimalType Sum of data of input column name of Row matching condition.
getFilter()
Returns the currently filtered condition.
return #expression The currently filtered expression condition.
getFilterExpr()
Returns the currently filtered condition.
return Expression The currently filtered expression condition.
getHeader(columnName)
Returns the Header object through the column name.
Parameters
name type description
columnName #column
return Header The Header object for the column name.
getHeaders(columnType)
Returns the headers of the corresponding HeaderType as an array.
Parameters
name type description
columnTypeoptional HeaderType defaultheader.HeaderType.ALL
return Header[] Header array of the corresponding HeaderType.
getMax(columnName)
Returns the maximum value among the data of the input column name.
The comparison standard follows the dataType of the corresponding column.
Parameters
name type description
columnName #column
return Object The maximum value in the column.
getMin(columnName)
Returns the minimum value among the data of the input column name.
The comparison standard follows the dataType of the corresponding column.
Parameters
name type description
columnName #column
return Object The smallest of the column name values.
getNumber(rowIndex, columnName)
Returns the data corresponding to the input rowIndex and columnName as a Number.
If the value is of type string and forced to Number, NaN is returned.
Parameters
name type description
rowIndex Number
columnName #column
return Number The Number type of the data.
getOriginalAvg(columnName)
Returns the average of the source data of the column names entered.
It should only be used when the value of the corresponding column name is of type Number.
Parameters
name type description
columnName #column
return DecimalType The average of the original values ​​of the column names.
getOriginalMax(columnName)
Returns the maximum value of the original data of the column name received.
Parameters
name type description
columnName #column
return Object The maximum value of the original value of this column.
getOriginalMin(columnName)
Returns the minimum value of the original data of the column name received.
Parameters
name type description
columnName #column
return Object The minimum value among the original values ​​of the column names.
getOriginalRowCount()
Returns the number of rows in the source data.
The number of rows is returned except for the INSERTED state and the INSERTDELETED state.
return Number Number of rows of source data.
getOriginalSum(columnName)
Returns the sum of the source data of the input column name.
It should only be used when the value of the corresponding column name is of type Number.
Parameters
name type description
columnName #column
return DecimalType The sum of the original values ​​of the column names.
getOriginalValue(rowIndex, columnName)
Returns the original data corresponding to the input rowindex and columnName.

When entering the incorrect ROW index or columnName, it returns null.
If there is no data from the input rowindex and columnName, it returns an empty string ("" ").
If the column data type is expression, it returns the execution execution results.
Parameters
name type description
rowIndex Number
columnName #column
return Object The corresponding source data.
getRow(index)
Returns the Row object at the row index.
Parameters
name type description
index Number
return IDataRow The Row object at the index.
getRowCount()
Returns the current number of rows.
return Number Number of rows.
getRowCountByState(state)
Returns the number of rows with the corresponding status value by state.
Parameters
name type description
state RowState
return {[key:number]: Number} The number of rows of the status value.
getRowData(rowIndex, columnType)
Returns the row data of the input row index in the format {columnName: value}.
Parameters
name type description
rowIndex Number
columnTypeoptional HeaderType defaultheader.HeaderType.ALL
return RowConfigInfo The row data of the corresponding row index. (key: columnName, value: json object of the corresponding value)
getRowDataRanged(startIndex, endIndex)
Returns an array of row data corresponding to the input range.
The array is a json object array and is of type {columnName: value}.
Parameters
name type description
startIndexoptional Number default0
endIndexoptional Number default(this.getRowCount() - 1)
return RowConfigInfo[] An array of row data in the range.
getRowDatasByState(state, columnType)
Returns an array of row data with the corresponding status values.
Parameters
name type description
state RowState
columnTypeoptional HeaderType defaultheader.HeaderType.ALL
return {[key:number]: cpr.data.RowConfigInfo[]} The row data array of the corresponding state value.
getRowIndicesByState(state)
Search the row with the corresponding status value and use the status value as the key value Returns a json object whose value is the row index array.
Parameters
name type description
state RowState
return {[key:number]: Number[]} A json object with the status value as the key value and the corresponding row index array as the value value.
getRowState(rowIndex)
View the status values ​​of a specific row

Returns null if the Row's Index is out of range.
Parameters
name type description
rowIndex Number
return RowState If you cannot find ROW, return NULL and return one of the following values.
State type:
CPR.Data.tabledata.rowstate.UNCHANGED: Unchanged state.
CPR.Data.tabledata.rowstate.Inserted: A new row added.
CPR.Data.tabledata.rowstate.updated: The row is modified.
CPR.Data.tabledata.rowstate.deleted: The row is deleted.
CPR.Data.tabledata.rowstate.Insertdeleted: The row has been added and deleted.
getRowStateString(rowIndex)
Returns the state value of a specific row as a string type.
Parameters
name type description
rowIndex Number
return String If the Row can not be found, it returns null; otherwise, it returns one of the following values:
Unchanged state: "UC", "UNCHANGED"
New row added: "I", "INSERTED"
Rows modified: "U", "UPDATED"
Deleted rows: "D", "DELETED"
The row was added and deleted: "ID", "INSERTDELETED"
getRowStatedCount(state)
Returns the number of rows with the corresponding status value.
Parameters
name type description
state RowState
return Number The number of rows of the status value.
getRowStatedIndex(state)
Retrieves the row with the corresponding status value and returns the row index.
Parameters
name type description
state RowState
return Number row index. (Returns -1 if there is no row for that state.)
getRowStatedIndices(state)
Retrieves a row with the corresponding status value and returns an array of row indices.
Parameters
name type description
state RowState
return Number[] row index array
getRowsAttr(attrName)
Returns an array of the attribute values ​​of the attribute name in all rows.
Parameters
name type description
attrName String
return String[] An array of the corresponding attribute values ​​for all rows.
getSort()
Returns the current sorting condition.
return #expression The currently sorted expression condition.
getSortExpr()
Returns the current sorting condition.
return Expression The currently sorted expression condition.
getString(rowIndex, columnName)
Returns the data corresponding to the input rowIndex and columnName as a String.
Parameters
name type description
rowIndex Number
columnName #column
return String The String type of the data.
getSum(columnName)
Returns the sum of the data of the input column name.
It should only be used when the value of the corresponding column name is of type Number.
Parameters
name type description
columnName #column
return DecimalType The sum of the column name values.
getUnfilteredDistinctValues(columnName, filterFnc, sortCondition)
Returns an array of non-overlapping values ​​of a specific column in the entire data.
You can use it by adding the filtering function you want.
(Total data means all data that has not been filtered.)
ex) Value of column a: 'a1', 'a2', 'a1', 'a3', 'a4', 'a3'
getUnfilteredDistinctValues ​​('a')
=> ['a1', 'a2', 'a3', 'a4']
Parameters
name type description
columnName #column
filterFncoptional (dataRow: cpr.data.IDataRow)=>Boolean
sortConditionoptional #expression
return Array Array of non-redundant values ​​for the column.
getUnfilteredRowCount(filterFnc)
Returns the number of rows corresponding to a specific filter value in the entire data.
(Total data means all data that has not been filtered.)
Parameters
name type description
filterFncoptional (dataRow: cpr.data.IDataRow)=>Boolean
return Number Number of rows corresponding to the filter value.
getUnfilteredRowDatas(filterFnc, columnType)
Returns an array of row data corresponding to a specific filter value in the entire data.
(Total data means all data that has not been filtered.)
Parameters
name type description
filterFncoptional (dataRow: cpr.data.IDataRow)=>Boolean defaultnull
columnTypeoptional HeaderType defaultheader.HeaderType.ALL
return RowConfigInfo[] Array of row data corresponding to the filter value.
getUnfilteredRowDatasByState(state, columnType)
Returns an array of row data with the corresponding status value from the entire data.
(Total data means all data that has not been filtered.)
Parameters
name type description
state RowState
columnTypeoptional HeaderType defaultheader.HeaderType.ALL
return {[key:number]: cpr.data.RowConfigInfo[]} Row data array of the corresponding state value in all data.
getUserAttrNames()
declaring typeControl
Returns all custom attribute names.
return String[] An array of all custom attribute names.
getValue(rowIndex, columnName)
Returns the data corresponding to the input Rowindex and ColumnName.
Parameters
name type description
rowIndex Number
columnName #column
return Object Data corresponding to the input rowindex and columnName
The return type is determined according to the header datatype.
In the case of decimal type, it is returned to CPR.FOUNDATION.DECIMIMALYPE .
To get the actual value from the decimal object, you must use tonumber () or toString () .
For Expression Type, we return the execution results.
If you have the desired data type, you must create an expression so that the execution results are returned to that type.

If the input rowindex is NULL IllegalargumentException
If the input rowindex is a value that does not exist within the range of row range, returns null . If there is a column of the input columnName, it returns the value .
If there is no column of the input columnName, it returns null .
If there is no value in the column of the input columnName, it returns a "(empty string) .
insertRow(index, after)
Add a new row before or after the desired row index.
An INSERTED event occurs.
Parameters
name type description
index Number
afteroptional Boolean defaulttrue
return IDataRow The new Row object you added.
insertRowData(index, after, rowData)
Enter rowData and add a new row before or after the desired row index.
An INSERTED event occurs.
Parameters
name type description
index Number
afteroptional Boolean defaulttrue
rowDataoptional RowConfigInfo defaultnull
return IDataRow The new Row object you added.
isAvailableBinding(propertyName)
declaring typeControl
Returns whether the queried property is bindable and the binding has been configured to obtain a valid value. Even if no binding is configured and a simple value is specified, it is treated as configured so that a valid value is obtained. For example, binding to a row index that does not exist in the DataSet is an invalid binding.
Parameters
name type description
propertyName #bindable-property_name Property name to check whether binding is valid.
return Boolean
isBindable(propertyName)
declaring typeControl
Make sure it is a bindable property.
Parameters
name type description
propertyName #bindable-property_name Attribute name
return Boolean Confirmation.
isDisplayColumn(columnName)
Returns whether this column name is Display Column.
Parameters
name type description
columnName #column
return Boolean Whether the column name is Display Column.
isExistColumn(columnName)
Returns whether this column name exists.
Parameters
name type description
columnName #column
return Boolean Whether the column name exists.
isModified()
Returns whether the dataset has changed
(whether there is a row in the inserted, deleted, or updated state)
return Boolean No change.
moveRowIndex(sourceIndex, targetIndex, after)
Converts the row at sourceIndex to targetIndex.
If targetIndex is greater than sourceIndex, the actual converted index is converted to targetIndex - 1.
Parameters
name type description
sourceIndex Number
targetIndex Number
afteroptional Boolean defaulttrue
parseData(datasetInfo)
Sets data set initial property, column information, and row data information.
Parameters
name type description
datasetInfo DataSetConfigInfo Dataset initial information.
{
  AltercolumnLayout: String, // Budded by BUILD Column Layout Change Criteria: "Client" or "Server" or "Merge".
  SortCondition ?: String, // Sort.
  FilterCondition ?: String, // filtering condition.
  INFO ?: String, // Dataset Information.
  Columns: {// Column Settings Information.
   Datatype: String, // Data type. ("String" or "number" or "date" or "decimal" or "" Expression ")
   Name: String, // column name.
   Displayonly ?: Boolean, // Display Column. (True: Display column, false or not    Expression ?: String, // Expression. (When Datatype = "Expression", EXPRESSION Settings)
   DefaultValue ?: String // Default.
  } [],
  Rows: {[ColumnName: String]: String | NUMBER} [] // Hang Data
}
pushRow()
Add a new row at the end.

The added row is added in the UNCHANGED state, not in the INSERTED state.
INSERTED event does not fire.
return IDataRow The new Row object you added.
pushRowData(rowData)
Enter rowData and add a new row at the end.

Added rows will be added as UNCHANGED states instead of INSERTED states.
No INSERTED event occurs.
Parameters
name type description
rowData RowConfigInfo
return IDataRow The new Row object you added.
pushRowSilently(rowData, parentRow)
At the end, a new row connected to the parent dataset is added with the data.

The added row will be added in UNCHANGED status instead of INSERTED status.
INSERTED event does not fire.
Parameters
name type description
rowDataoptional RowConfigInfo
parentRowoptional IDataRow
return IDataRow
putValue(rowIndex, columnName, value)
Change the value of the input rowIndex and columnName to only the value without changing the row state.

Row state changes do not occur and no corresponding events occur.
Parameters
name type description
rowIndex Number
columnName #column
value Object
return Boolean Whether the value modification succeeded.
realDeleteRow(rowIndex)
Enter the row index and completely remove the row.
The original row is removed, so the previous state is not remembered.
Parameters
name type description
rowIndex Number
return Boolean Successful deletion of rows.
refresh()
Reconstruct view data based on source data
filter, sort will not be removed.

※ You can not keep the existing order. Rebuild the viewTable based on the data in the dataTable.
sort, filter applied
removeAllEventListeners()
declaring typeControl
Removes all event listeners for the control.
removeAllUserAttr()
declaring typeControl
Delete all custom attributes.
removeEventListener(type, listener)
declaring typeControl
Remove Listener for each EventType in the control.
control.removeEventListener ('click', listener);  
Parameters
name type description
type String Event type.
listener (e: cpr.events.CEvent)=>Void Event listeners.
removeEventListeners(type)
declaring typeControl
Remove all EventType listeners from the control.
control.removeEventListeners ('click');  
Parameters
name type description
type String Event type.
removeUserAttr(key)
declaring typeControl
Removes user-defined attributes for a specific attribute name.
Parameters
name type description
key String The custom attribute name to remove.
resetCondition()
The sort and filter applied to the dataset will be initialized.
revert()
Revert to last commit state
If there is no last commit, it returns to the initial state.

1. Only changes to the Row state are made, The row index changed by sort / filter is not saved.
2. Display Column does not revert to original value
3. Change status
UNCHANGED: No change.
INSERTED, INSERTDELETED: Deleted from source data.
UPDATED, DELETED: Changed raw value to original value and changed to UNCHANGED Row.
revertRow(rowIndex)
Only the data at a specific row index is rounded.
Parameters
name type description
rowIndex Number
setFilter(condition)
Filter view data by specifying filtering criteria
Existing filtering conditions are removed.
Parameters
name type description
condition #expression
setFilterExpr(condition)
Filter view data by specifying filtering criteria
Existing filtering conditions are removed.
Parameters
name type description
condition Expression
setRowState(rowIndex, state)
Changes the state value of a specific row.
Parameters
name type description
rowIndex Number
state RowState
setRowStateAll(state)
Change the status value of the entire row to the input status value.
Parameters
name type description
state RowState
setRowStateRanged(state, startIndex, endIndex)
Changes the status value of the input row range to the input status value.
Parameters
name type description
state RowState
startIndexoptional Number default0
endIndexoptional Number default(this.getRowCount() - 1)
setRowsAttr(attrName, attrValue)
Batch modifies the attribute values ​​of the attribute names in all rows.
Parameters
name type description
attrName String
attrValue String
setSort(condition)
Sort the view data by specifying the sort condition.
Existing sort conditions are removed.
Parameters
name type description
condition #expression
setSortExpr(condition)
Sort the view data by specifying the sort condition.
Existing sort conditions are removed.
Parameters
name type description
condition Expression
setUnfilteredRowStateAll(state)
Change the status value of all data to the received status value.
(Total data means all data that has not been filtered.)
Parameters
name type description
state RowState
setValue(rowIndex, columnName, value)
Correct the data corresponding to the received rowIndex and columnName.

1. Change of state
When the column corresponding to the columnName is not a DisplayColumn and the row state is UNCHANGED Row status changes to UPDATED. (UNCHANGED-> UPDATED)
Rows that are DELETED or INSERTED cannot be modified.
2. Event
UPDATED event is fired when it is modified.
Parameters
name type description
rowIndex Number
columnName #column
value Object
return Boolean Whether the value modification succeeded.
unbind(propertyName)
declaring typeControl
Unbind that property.
Parameters
name type description
propertyName #bindable-property_name Attribute name to unbind.
updateRow(rowIndex, rowData)
It takes data in the format {columnName: value} and makes a complete change to the data in a particular row.
If columnData does not contain rowData, the existing value is retained.
Parameters
name type description
rowIndex Number
rowData RowConfigInfo
return Boolean Whether the value modification succeeded.
userAttr(key, value)
declaring typeControl
Specifies custom properties.
Parameters
name type description
key String The attribute name to assign
value String The attribute value to specify.
userAttr(key)
declaring typeControl
Returns a user-defined property.
Parameters
name type description
key String The attribute name to get.
return String Custom properties.
userAttr(values)
declaring typeControl
Specify multiple custom properties at once.
Parameters
name type description
values {[key:string]: String} A JSON object containing custom attribute keys/values.
userAttr()
declaring typeControl
Get all custom properties in the form of a map.
return {[key:string]: String}
userData(key, value)
declaring typeControl
Specifies custom data. Unlike user-defined attributes, you can use arbitrary types in addition to strings. When the control is dispose, all custom data is removed.
Parameters
name type description
key String The key of the data to be specified.
value Object Data to specify.
userData(key)
declaring typeControl
get custom data
Parameters
name type description
key String The key of the data to get.
return Object
userData(override)
declaring typeControl
Specifies multiple user-defined data.
Parameters
name type description
override {[key:string]: Object} A JSON object containing user-defined data.
userData()
declaring typeControl
Get all your custom data.
return {[key:string]: Object}
userattr()
declaring typeControl
deprecatedPlease use userAttr.
Returns a user-defined property.
return Object Custom properties.