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.
Index
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. |
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. |
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
name |
type |
description |
id
|
String |
Returns the ID of the control. |
Events
CDataEvent An event raised before a row is deleted.
Occurrence method: deleteRow, realDeleteRow
row: {cpr.data.Row} Row object to be deleted
CDataEvent An event that occurs before a row is added.
Method of occurrence: addRow, addRowData, insertRow, insertRowData
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 pre>
columnName: {string} Column name of the data to be modified pre>
beforeValue: {any} the previous value of the cell you want to modify pre>
currentValue: {string} current value pre>
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".
CDataEvent Event that occurs when a row is deleted.
Method of occurrence: deleteRow, realDeleteRow
row: {cpr.data.Row} deleted row object pre>
CDataEvent Event that occurs when data is filtered.
Methods of occurrence: setFilter, setFilterExpr, clearFilter
CDataEvent Events that occur when rows are added.
Methods of occurrence: addRow, addRowData, insertRow, insertRowData
row: {cpr.data.Row} Added row object pre>
CDataEvent An event that occurs when the data structure is reconstructed by the build method.
CDataEvent An event that occurs when the data is sorted.
Methods of occurrence: setSort, setSortExpr, clearSort
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. pre>
columnName: {string} The column name of the data you want to modify. pre>
beforeValue: {any} The previous value of the cell you want to modify. pre>
currentValue: {string} current value pre>
Properties
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".
|
declaring type
|
Control |
type
|
Boolean |
readonly
|
Returns whether the control should be removed.
|
declaring type
|
Control |
type
|
String |
readonly
|
Returns the ID of the control.
|
type
|
String |
get
|
Returns the dataset information value.
|
set
|
Sets the dataset information value.
|
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)
|
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
|
declaring type
|
Control |
type
|
String |
readonly
|
Returns the unique ID of the control.
|
Methods
Add Column.
UPDATED event occurs when a value is added to a column added with addColumn. b>
name |
type |
description |
column
|
Header |
|
return
|
Boolean |
Whether the column was successfully added. |
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. b>
Column that does not participate in Row state change and is not transmitted as request data even in submission communication. u>
name |
type |
description |
column
|
Header |
|
return
|
Boolean |
Whether the column was successfully added. |
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...
});
name |
type |
description |
type
|
String |
Event type. |
listener
|
(e: cpr.events.CEvent)=>Void |
Event listeners. |
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...
});
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. |
Add a new row at the end.
An INSERTED event occurs. b>
return
|
IDataRow |
The new Row object you added. |
Enter rowData and add a new row at the end.
An INSERTED event occurs. b>
return
|
IDataRow |
The new Row object you added. |
Bind that property.
name |
type |
description |
propertyName
|
#bindable-property_name |
The attribute name to bind. |
Bind the line of the parent dataset.
Bind it with the line ID of the parent dataset.
name |
type |
description |
rowId
|
String |
|
Configure the DataSet via json data.
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. |
Replace the position of two rows.
name |
type |
description |
sourceIndex
|
Number |
|
targetIndex
|
Number |
|
Removes data set information.
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. |
Remove all rows in the dataset.
name |
type |
description |
emitEventoptional
|
Boolean |
defaulttrue
|
|
Remove the filtering condition.
Remove the sort condition.
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.
Copies data from the current dataset to the target datamap.
Only the data in the existing columns of the target dataset is copied.
name |
type |
description |
targetDataMap
|
DataMap |
|
rowIndex
|
Number |
|
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.
name |
type |
description |
targetDataSet
|
DataCollection |
|
filterConditionoptional
|
#expression |
|
Delete the Column. (Including Display column)
name |
type |
description |
columnName
|
#column |
|
return
|
Boolean |
Whether the column was successfully deleted. |
Get the row index and remove the row.
DELETED event is fired. b>
name |
type |
description |
rowIndex
|
Number |
|
return
|
Boolean |
Successful deletion of rows. |
Forwards specific events.
name |
type |
description |
e
|
CEvent |
event |
return
|
Boolean |
Successful event delivery. |
Removes the objects contained in the control.
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)
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. |
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.
name |
type |
description |
condition
|
#expression |
|
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)
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. |
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.
Returns the first Row object in the specified range that meets the condition.
※ Search by reference. (Search based on the current data)
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. |
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.
name |
type |
description |
condition
|
#expression |
|
Returns the first Row object in the specified range that meets the condition.
※ Search by reference. (Search based on the current data)
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. |
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.
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'.
name |
type |
description |
rowID
|
String |
|
return
|
IDataRow |
Row object that matches the row ID |
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.
name |
type |
description |
rowID
|
String |
|
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.
name |
type |
description |
condition
|
#expression |
|
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.
Process data row by row for the entire data.
(Total data means all data that has not been filtered.)
name |
type |
description |
processFnc
|
(dataRow: cpr.data.IDataRow)=>Void |
|
Returns the app instance to which the control belongs.
return
|
AppInstance |
The app instance the control belongs to. |
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.
name |
type |
description |
columnName
|
#column |
|
return
|
DecimalType |
The average of the values in that column name. |
Returns the bind context.
Returns the bind property information for the control.
name |
type |
description |
propertyName
|
#bindable-property_name |
The name of the attribute being bound. |
Returns the row ID of the linked parent dataset.
return
|
String |
Row ID of the parent dataset. |
Returns the Boolean data corresponding to the input rowIndex and columnName.
name |
type |
description |
rowIndex
|
Number |
|
columnName
|
#column |
|
return
|
Boolean |
The Boolean type of the data. |
Returns the Column object for that column name.
name |
type |
description |
name
|
#column |
|
return
|
Column |
The Column object for the corresponding column. |
Returns the number of columns.
return
|
Number |
Number of columns. |
Returns the data of the column corresponding to the input columnName as an array type.
name |
type |
description |
columnName
|
#column |
|
return
|
Array |
An array of all the data in the columnName. |
Returns the column name in array format.
name |
type |
description |
columnTypeoptional
|
HeaderType |
defaultheader.HeaderType.ALL
|
|
return
|
String[] |
An array of column names. |
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.
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. |
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.
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. |
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.
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. |
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.
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. |
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.
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. |
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.
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. |
Returns the number of rows that match the condition.
※ In the view base row, search for the row that satisfies the condition.
name |
type |
description |
condition
|
#expression |
|
return
|
Number |
Number of rows matching the condition. |
Returns the number of rows that match the condition.
※ In the view base row, search for the row that satisfies the condition.
return
|
Number |
Number of rows matching the condition. |
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.
name |
type |
description |
condition
|
#expression |
|
columnName
|
#column |
|
return
|
DecimalType |
Sum of data of input column name of Row matching condition. |
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.
name |
type |
description |
condition
|
Expression |
|
columnName
|
#column |
|
return
|
DecimalType |
Sum of data of input column name of Row matching condition. |
Returns the currently filtered condition.
return
|
#expression |
The currently filtered expression condition. |
Returns the currently filtered condition.
return
|
Expression |
The currently filtered expression condition. |
Returns the Header object through the column name.
name |
type |
description |
columnName
|
#column |
|
return
|
Header |
The Header object for the column name. |
Returns the headers of the corresponding HeaderType as an array.
name |
type |
description |
columnTypeoptional
|
HeaderType |
defaultheader.HeaderType.ALL
|
|
return
|
Header[] |
Header array of the corresponding HeaderType. |
Returns the maximum value among the data of the input column name.
The comparison standard follows the dataType of the corresponding column.
name |
type |
description |
columnName
|
#column |
|
return
|
Object |
The maximum value in the column. |
Returns the minimum value among the data of the input column name.
The comparison standard follows the dataType of the corresponding column.
name |
type |
description |
columnName
|
#column |
|
return
|
Object |
The smallest of the column name values. |
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.
name |
type |
description |
rowIndex
|
Number |
|
columnName
|
#column |
|
return
|
Number |
The Number type of the data. |
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.
name |
type |
description |
columnName
|
#column |
|
return
|
DecimalType |
The average of the original values of the column names. |
Returns the maximum value of the original data of the column name received.
name |
type |
description |
columnName
|
#column |
|
return
|
Object |
The maximum value of the original value of this column. |
Returns the minimum value of the original data of the column name received.
name |
type |
description |
columnName
|
#column |
|
return
|
Object |
The minimum value among the original values of the column names. |
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. |
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.
name |
type |
description |
columnName
|
#column |
|
return
|
DecimalType |
The sum of the original values of the column names. |
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.
name |
type |
description |
rowIndex
|
Number |
|
columnName
|
#column |
|
return
|
Object |
The corresponding source data. |
Returns the Row object at the row index.
name |
type |
description |
index
|
Number |
|
return
|
IDataRow |
The Row object at the index. |
Returns the current number of rows.
return
|
Number |
Number of rows. |
Returns the number of rows with the corresponding status value by state.
return
|
{[key:number]: Number} |
The number of rows of the status value. |
Returns the row data of the input row index in the format {columnName: value}.
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) |
Returns an array of row data corresponding to the input range.
The array is a json object array and is of type {columnName: value}.
name |
type |
description |
startIndexoptional
|
Number |
default0
|
|
endIndexoptional
|
Number |
default(this.getRowCount() - 1)
|
|
Returns an array of row data with the corresponding status values.
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. |
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.
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. |
View the status values of a specific row
Returns null if the Row's Index is out of range.
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. |
Returns the state value of a specific row as a string type.
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" |
Returns the number of rows with the corresponding status value.
return
|
Number |
The number of rows of the status value. |
Retrieves the row with the corresponding status value and returns the row index.
return
|
Number |
row index. (Returns -1 if there is no row for that state.) |
Retrieves a row with the corresponding status value and returns an array of row indices.
return
|
Number[] |
row index array |
Returns an array of the attribute values of the attribute name in all rows.
name |
type |
description |
attrName
|
String |
|
return
|
String[] |
An array of the corresponding attribute values for all rows. |
Returns the current sorting condition.
return
|
#expression |
The currently sorted expression condition. |
Returns the current sorting condition.
return
|
Expression |
The currently sorted expression condition. |
Returns the data corresponding to the input rowIndex and columnName as a String.
name |
type |
description |
rowIndex
|
Number |
|
columnName
|
#column |
|
return
|
String |
The String type of the data. |
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.
name |
type |
description |
columnName
|
#column |
|
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']
name |
type |
description |
columnName
|
#column |
|
filterFncoptional
|
(dataRow: cpr.data.IDataRow)=>Boolean |
|
sortConditionoptional
|
#expression |
|
return
|
Array |
Array of non-redundant values for the column. |
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.)
name |
type |
description |
filterFncoptional
|
(dataRow: cpr.data.IDataRow)=>Boolean |
|
return
|
Number |
Number of rows corresponding to the filter value. |
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.)
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. |
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.)
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.
|
Returns all custom attribute names.
return
|
String[] |
An array of all custom attribute names. |
Returns the data corresponding to the input Rowindex and ColumnName.
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) . |
Add a new row before or after the desired row index.
An INSERTED event occurs. b>
name |
type |
description |
index
|
Number |
|
afteroptional
|
Boolean |
defaulttrue
|
|
return
|
IDataRow |
The new Row object you added. |
Enter rowData and add a new row before or after the desired row index.
An INSERTED event occurs. b>
name |
type |
description |
index
|
Number |
|
afteroptional
|
Boolean |
defaulttrue
|
|
rowDataoptional
|
RowConfigInfo |
defaultnull
|
|
return
|
IDataRow |
The new Row object you added. |
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.
name |
type |
description |
propertyName
|
#bindable-property_name |
Property name to check whether binding is valid. |
Make sure it is a bindable property.
name |
type |
description |
propertyName
|
#bindable-property_name |
Attribute name |
return
|
Boolean |
Confirmation. |
Returns whether this column name is Display Column.
name |
type |
description |
columnName
|
#column |
|
return
|
Boolean |
Whether the column name is Display Column. |
Returns whether this column name exists.
name |
type |
description |
columnName
|
#column |
|
return
|
Boolean |
Whether the column name exists. |
Returns whether the dataset has changed
(whether there is a row in the inserted, deleted, or updated state)
return
|
Boolean |
No change. |
Converts the row at sourceIndex to targetIndex.
If targetIndex is greater than sourceIndex, the actual converted index is converted to targetIndex - 1.
name |
type |
description |
sourceIndex
|
Number |
|
targetIndex
|
Number |
|
afteroptional
|
Boolean |
defaulttrue
|
|
Sets data set initial property, column information, and row data information.
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
} |
Add a new row at the end.
The added row is added in the UNCHANGED state, not in the INSERTED state. b>
INSERTED event does not fire. b>
return
|
IDataRow |
The new Row object you added. |
Enter rowData and add a new row at the end.
Added rows will be added as UNCHANGED states instead of INSERTED states. b>
No INSERTED event occurs. b>
return
|
IDataRow |
The new Row object you added. |
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.
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. b>
name |
type |
description |
rowIndex
|
Number |
|
columnName
|
#column |
|
value
|
Object |
|
return
|
Boolean |
Whether the value modification succeeded. |
Enter the row index and completely remove the row.
The original row is removed, so the previous state is not remembered.
name |
type |
description |
rowIndex
|
Number |
|
return
|
Boolean |
Successful deletion of rows. |
Reconstruct view data based on source data
filter, sort will not be removed. u>
※ You can not keep the existing order.
Rebuild the viewTable based on the data in the dataTable.
sort, filter applied
Removes all event listeners for the control.
Delete all custom attributes.
Remove Listener for each EventType in the control.
control.removeEventListener ('click', listener); code> pre>
name |
type |
description |
type
|
String |
Event type. |
listener
|
(e: cpr.events.CEvent)=>Void |
Event listeners. |
Remove all EventType listeners from the control.
control.removeEventListeners ('click'); code> pre>
name |
type |
description |
type
|
String |
Event type. |
Removes user-defined attributes for a specific attribute name.
name |
type |
description |
key
|
String |
The custom attribute name to remove. |
The sort and filter applied to the dataset will be initialized.
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.
Only the data at a specific row index is rounded.
name |
type |
description |
rowIndex
|
Number |
|
Filter view data by specifying filtering criteria
Existing filtering conditions are removed.
name |
type |
description |
condition
|
#expression |
|
Filter view data by specifying filtering criteria
Existing filtering conditions are removed.
Changes the state value of a specific row.
name |
type |
description |
rowIndex
|
Number |
|
state
|
RowState |
|
Change the status value of the entire row to the input status value.
Changes the status value of the input row range to the input status value.
name |
type |
description |
state
|
RowState |
|
startIndexoptional
|
Number |
default0
|
|
endIndexoptional
|
Number |
default(this.getRowCount() - 1)
|
|
Batch modifies the attribute values of the attribute names in all rows.
name |
type |
description |
attrName
|
String |
|
attrValue
|
String |
|
Sort the view data by specifying the sort condition.
Existing sort conditions are removed.
name |
type |
description |
condition
|
#expression |
|
Sort the view data by specifying the sort condition.
Existing sort conditions are removed.
Change the status value of all data to the received status value.
(Total data means all data that has not been filtered.)
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. B>
name |
type |
description |
rowIndex
|
Number |
|
columnName
|
#column |
|
value
|
Object |
|
return
|
Boolean |
Whether the value modification succeeded. |
Unbind that property.
name |
type |
description |
propertyName
|
#bindable-property_name |
Attribute name to unbind. |
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.
return
|
Boolean |
Whether the value modification succeeded. |
Specifies custom properties.
name |
type |
description |
key
|
String |
The attribute name to assign |
value
|
String |
The attribute value to specify. |
Returns a user-defined property.
name |
type |
description |
key
|
String |
The attribute name to get. |
return
|
String |
Custom properties. |
Specify multiple custom properties at once.
name |
type |
description |
values
|
{[key:string]: String} |
A JSON object containing custom attribute keys/values. |
Get all custom properties in the form of a map.
return
|
{[key:string]: String} |
|
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.
name |
type |
description |
key
|
String |
The key of the data to be specified. |
value
|
Object |
Data to specify. |
get custom data
name |
type |
description |
key
|
String |
The key of the data to get. |
Specifies multiple user-defined data.
name |
type |
description |
override
|
{[key:string]: Object} |
A JSON object containing user-defined data. |
Get all your custom data.
return
|
{[key:string]: Object} |
|
Returns a user-defined property.
return
|
Object |
Custom properties. |