PropertyEventMethodIndex
WebSquare.uiplugin.dataList - 5.0_4.4427B.20210603.112955

An object that stores multiple data sets to be used for data submission and web pages to display data.
Created under a DataCollection, and consists of Column Info that defines the data structure and the Data that has the default data.
The Column Info (source : <w2:columnInfo>) has column information as well as column names in the id field. The developer can also define additional properties for data processing.
The Data (source : <w2:data>) stores the default values of each column. Select the use data field (source : <w2:data use="true">) to use the default data.
The DataList has status values for each row caused by the end user's control such as Insert, Update, and Remove. The developer can get the status using getter API as shown below. The details are as shown below.
status : R / statusValue : 0 - Default. (Unchanged.)
status : U / statusValue : 1 - Updated. (Upon calling of the update API)
status : C / statusValue : 2 - Inserted. (Upon calling of the insert API)
status : D / statusValue : 3 - Deleted. (Upon calling of the delete API)
status : V / statusValue : 4 - Inserted and deleted. (Upon calling of the insert API)
status : E / statusValue : 5 - Removed. (Upon calling of the remove API)

Type

uiplugin

Property Summary

attributeMap
Relevant only when the DataType is XML. Name of the DataMap to define an additional attribute in the rootNode. The key and the value of the DataMap will be defined as the attribute name and the attribute value of the rootNode.
baseNode
[default:list] Relevant only when the DataType is XML. Specify the XPath to define as the root node when converting the data into XML.
getMatchedFromAllData
[default:false, true]
id
DataList ID.
idAttribute
Relevant only when the DataType is XML. Uses the DataList ID as a separate attribute (to be defined here).
initRowPosition
Index of the row to set as rowPosition when creating a dataList
matchIgnoreCase
[default:false] Sets capital-sensitive status when calling APIs such as getMatchedJSON, getMatchedIndex, etc.
removedDataMatch
Keeps a separate structure for the data returned by getModifiedXML, getDeleteXML, getVoidXML, or getOnlyDeleteXML with the XML structure being removed. False is to keep a separate structure.
removeDummyRowStatus
Manages the data of which status has changed from C to E (by removeRow API).
repeatNode
[default:map] Relevant only when the DataType is XML. Specifies the XPath of the node for the repeated data upon data conversion into XML.
rowNumData
[default:false] Whether to return the data by allocating row order (index +1) as the rowNum (key) or not.
rowStatusNodeName
Sets the name of the rowStatus key (node) when getting the data in JSON or XML format. The default is rowStatus.
saveRemovedData
Saves the data of which status is E (removed data by removeRow API).
undoRecursiveRow
Executes the undoRow on the row of the specified rowIndex as well as all child rows in the drilldown column.
userData1
User-defined property
userData2
User-defined property
userData3
User-defined property
validateAllItemsetData
[default:false, true] Validates all data even when the dataList is bound a certain itemset and the data is filtered.
valueAttribute
Relevant only when the DataType is XML. Allocates the actual data to the attribute.

Event Summary

onaftercolumnfilterchange
Triggered after the filter applied to the column is changed.
onbeforecelldatachange
Triggered right before the data of a cell is changed. The developer can decide whether to apply the new data to the DataList or not.
onbeforecolumnfilterchange
Triggered right before the filter applied to the column is changed by the end user.
onbeforerowpositionchange
Triggered right before the rowPosition of the DataList changes. The developer can decide whether to apply the new rowPosition or not.
oncelldatachange
Triggered when the data of a single cell is changed. Not generated upon changes in the entire DataList structure (through the use of setJSON and so on).
ondataload
Triggered when the entire data of the DataList is set. The event is triggered after the data is set.
oninsertrow
Triggered after a new row is added to the DataList. Although multiple rows are added at the same time, the event will occur only once.
onremoverow
Triggered when a row is removed from the DataList. Triggered when removeRow, removeRows, removeRange, or removeAll API is called.
onrowpositionchange
Triggered when the rowPosition of the DataList changes.

Method Summary

bind( eventType , function )
Dynamically allocates the events of the DataList.
clearFilter( )
Clears all currently-applied filters in the dataList.
clearSort( )
Cancels data sorting as well as sorting in the GridView component.
deleteRow( rowIndex )
Changes the status value into D (deleted) only without deleting the actual row of the corresponding row index.
deleteRows( rowIndexArr )
Changes the status of multiple rows of the specified indices into “D” simultaneously and returns the data of the deleted rows in a two-dimensional form.
getAllArray( )
Converts the entire DataList data into column information and a one-dimensional array, and returns in JSON format.
getAllData( )
Returns the entire data of the DataList as a one-dimensional array.
getAllFilteredData( )
Returns the entire filtered data as an array.
getAllFilteredJSON( )
Returns the entire filtered data as JSON data.
getAllFilteredXML( )
Returns the entire filtered data as XML data.
getAllJSON( )
Converts single-row data of the DataList into JSON, and returns the entire data as a one-dimensional array.
getAllXML( )
Returns the entire data of the DataList in XML.
getCellAllData( realRowIndex , colInfo )
Executes getCellData based on the rowIndex of the unfiltered data.
getCellData( rowIndex , colInfo )
Returns the data of the cell of the corresponding row index and the column index or ID.
getColData( colInfo )
Returns the data of the rows of the corresponding column index or ID as an array (without filtering or sorting).
getColumnDistinctDataArray( column )
Removes overlapping data in the column of the specified index or ID, and returns the result data in a array form sorted in ascending powers, and specified column.
getColumnID( colIndex )
Receives the index of the column, and returns the ID of the corresponding column.
getColumnIndex( colID )
Receives the ID of the column, and returns the index of the corresponding column.
getColumnInfo( columnID )
Gets details of a certain column on the DataList.
getColumnName( columnInfo )
Receives the index or ID of the column, and returns the name of the corresponding column.
getDataRow( rowIndex )
Returns the data of the row of the corresponding row index in hash format in which the column ID is used as the key.
getDeletedArray( )
Deleted status. JSON that has information about the rows in deleted, removed, or inserted and deleted status (such as D, E, or V).
getDeletedData( )
A two-dimensional array of the rows in deleted, removed, or inserted and deleted status (such as D, E, or V)
getDeletedIndex( )
Returns the indices of the rows in deleted status (such as D, V, 3, or 4) as an array.
getDeletedJSON( )
Converts the data of the rows in deleted, removed, or inserted and deleted status (such as D, E, or V) into JSON and returns as an array.
getDeletedXML( )
Returns the data of the rows in deleted status (D, E, or V) as an XML.
getFilteredColData( colInfo )
Returns the filtered or sorted data as JSON data.
getFilteredRowIndex( realRowIndex )
Returns the index of the row that has been filtered.
getFilterList( )
Returns the filtering status of each column in the filtered DataList.
getFusionChartData( chartType , labelNode , seriesColumns )
Returns the DataList as JSON data for the FusionChart component.
getFusionChartSimpleData( chartType , labelNode , seriesNode , valueNode )
Returns the DataList as JSON data for the FusionChart component in the simple mode - singleSerise and multiSeries.
getID( )
Gets the ID of the DataList object. Same as the object ID.
getInfo( )
Gets details of the DataList.
getInsertedArray( )
Gets JSON data that includes rows in inserted (or C) status.
getInsertedData( )
Two-dimensional array that contains the data of the rows that is in inserted (or C) status.
getInsertedIndex( )
Returns the indices of the rows in inserted (or C) status as an array.
getInsertedJSON( )
Converts the data of the rows in Inserted status (or C) into JSON and returns them as an array.
getInsertedXML( )
Converts the data of the rows in Inserted status (or C) as an XML.
getMatchedArray( colInfo , dataValue , exactMatch , stRowIndex , lastRowIndex )
Returns the JSON data of the rows of which colInfo is dataValue among the rows between stRowIndex and lastRowIndex.
getMatchedColumnData( matchCol , dataValue , targetCol , exactMatch , stRowIndex , lastRowIndex )
Returns the data of the rows of which matchCol is dataValue among the rows between stRowIndex and lastRowIndex as a one-dimensional array.
getMatchedData( colInfo , dataValue , exactMatch , stRowIndex , lastRowIndex )
Returns the data of the rows of which colInfo is dataValue among the rows between stRowIndex and lastRowIndex as a two-dimensional array.
getMatchedIndex( conInfo , dataValue , exactMatch , stRowIndex , lastRowIndex )
Returns the indices the rows of which colInfo is dataValue among the rows between stRowIndex and lastRowIndex.
getMatchedJSON( colInfo , dataValue , exactMatch , stRowIndex , lastRowIndex )
Returns the JSON data of the rows of which colInfo is dataValue among the rows between stRowIndex and lastRowIndex as an array.
getMatchedXML( colInfo , dataValue , exactMatch , stRowIndex , lastRowIndex )
Returns the data of the rows of which colInfo is dataValue among the rows between stRowIndex and lastRowIndex as an XML.
getModifiedArray( )
Gets the rows which are in a modified status (C, U, D, or E) as JSON.
getModifiedData( )
Returns the data of the rows in a modified status such as (C, U, D or E) as an array.
getModifiedIndex( )
Returns the indices of the rows in a modified status such as (C, U, or D) as an array.
getModifiedJSON( options )
Converts the data of the rows in updated, inserted, deleted, or removed status (U, C, D, E, 1, 2, 3, or 5) into JSON and returns them as a one-dimensional array.
getModifiedXML( options )
Converts the data of the rows in updated, inserted, deleted, or removed status (U, C, D, E, 1, 2, 3, or 5) into an XML.
getObjectType( )
Returns the type of the DataCollection.
getOnlyDeletedArray( )
Returns JSON data that contains information of the rows in deleted or removed status (D or E).
getOnlyDeletedData( )
Returns the deleted or removed status (D or E) as a two-dimensional array.
getOnlyDeletedIndex( )
Returns the indices of the rows in deleted status (D) as an array.
getOnlyDeletedJSON( )
Returns the JSON data of the rows in deleted or removed status (D or E) as an array.
getOnlyDeletedXML( )
Returns the data of the rows in deleted or removed status (D or E) as an XML.
getOption( attr )
Returns the attributes defined for the DataList.
getOriginalCellData( rowIndex , colIndex )
Returns the initial data of the cell of the corresponding rowIndex and the colInfo.
getParentRowIndex( rowIndex )
Returns the rowIndex of the parent row when the drilldown is used.
getRangeArray( fromIdx , toIdx )
Returns JSON that contains column information and data of the rows between fromIdx and toIdx.
getRangeData( from , to )
Returns the data of the rows in the specified range as a one-dimensional data.
getRangeJSON( from , to )
One-dimensional array containing JSON data of the rows within the specified range.
getRangeXML( from , to )
Returns the data of the rows in the specified range as an XML.
getRealRowIndex( )
Returns the actual row index.
getRecursiveRowIndex( )
Returns all rows under the row index as an array when the depthColumn is in use.
getRowArray( rowIndex )
Returns JSON data that contains information of the row of the corresponding rowIndex.
getRowCount( )
Returns the number of the rows currently displayed. Filtered rows and the drilled-down rows on the gridView will not be counted.
getRowData( rowIndex )
Returns the data or the rows of the corresponding rowIndex as an array.
getRowIndexByStatus( statusStr )
Returns the indices of the rows of the corresponding status (or code).
getRowJSON( rowIndex )
Returns the data of the row of the corresponding index as a JSON object.
getRowPosition( )
Gets the index of the current row of the bound DataList.
getRowStatus( rowIndex )
Returns the status of the row of the corresponding rowIndex as a code.
getRowStatusValue( rowIndex )
Returns the status of the specified row.
getRowXML( rowIndex )
Returns the data of the row of the corresponding rowIndex as an XML.
getScope( )
Returns the parent WFrame object when the component is a child of the WFrame which uses the scope feature (scope=true). Returns null if not the child of the scoping-enabled (scope=true) WFrame.
getScopeWindow( )
Returns the scope object of the parent when the component is a child of the WFrame which uses the scope feature (scope=true). Returns the window object if not a child of the scoping-enabled (scope=true) WFrame.
getTotalCol( )
Returns the number of the columns defined in the DataList.
getTotalRow( )
Returns the total number of the rows in the DataList.
getUnmatchedArray( col , dataValue , exactMatch , stRowIndex , lastRowIndex )
Converts the data of the row of which rowIndex is between stRowIndex and lastRowIndex and of which data is different from dataValue into JSON.
getUnmatchedColumnData( matchCol , dataValue , targetCol , exactMatch , stRowIndex , lastRowIndex )
Returns the data of the targetCol of which rowIndex of the specified matchCol is not same as dataValue among the rows between stRowIndex and lastRowIndex as JSON.
getUnmatchedData( col , dataValue , exactMatch , stRowIndex , lastRowIndex )
Returns the data of the rows of which rowIndex of the specified column is not same as dataValue among the rows between stRowIndex and lastRowIndex as an array.
getUnmatchedIndex( col , dataValue , exactMatch , stRowIndex , lastRowIndex )
Returns the indices of the rows of which rowIndex of the specified column is not same as dataValue among the rows between stRowIndex and lastRowIndex as an array.
getUnmatchedJSON( col , dataValue , exactMatch , stRowIndex , lastRowIndex )
Converts the data of the rows of which rowIndex of the specified column is not same as dataValue among the rows between stRowIndex and lastRowIndex into JSON and returns as an array.
getUnmatchedXML( col , dataValue , exactMatch , stRowIndex , lastRowIndex )
Returns the indices of the rows of which rowIndex of the specified column is not same as dataValue among the rows between stRowIndex and lastRowIndex as an array.
getUpdatedArray( )
Returns the data of the rows in updated status (1, U) as JSON.
getUpdatedData( )
Returns the data of the rows in the updated status (1, U) as an array.
getUpdatedIndex( )
Returns the indices of the rows in the updated status (1, U) as an array.
getUpdatedJSON( )
Converts the data of the rows in updated status (1 or U) into JSON and returns as an array.
getUpdatedXML( )
Returns the data of the rows in update status (1 or U) as an XML.
getVoidArray( )
Returns the rows in removed and deleted status (4 or V) as JSON.
getVoidData( )
Returns the rows in inserted and removed status (4 or V) as an array.
getVoidIndex( )
Returns the indices of the rows in inserted and deleted status (4 or V) as an array.
getVoidJSON( )
Returns the JSON data of the rows in inserted and removed status (4 or V) as an array.
getVoidXML( )
Returns the data of the rows in inserted and removed status (4, V) as an XML.
initRowStatus( )
Changes status of all DataList into “R”.
insertData( rowIndex , dataObj )
Inserts multiple rows into the rowIndex as one-dimensional array.
insertJSON( rowIndex , dataObj )
Inserts multiple rows into the rowIndex as a JSON object.
insertRow( rowIndex )
Inserts a single row to the rowIndex.
insertXML( rowIndex , dataObj )
Inserts multiple rows into the rowIndex as XML data.
keepRowPosition( )
Keeps the previous rowPosition when appending the JSON data.
modifyAllStatus( status )
Modifies the status of all rows.
modifyMatchedStatus( col , dataValue , status )
Modifies the status of the rows in which the specified column is same as dataValue.
modifyRangeStatus( from , to , status )
Modifies the status of the rows within the specified range.
modifyRowStatus( rowIndex , status )
Modifies the status of the rows of the corresponding rowIndex.
multisort( options )
Sorts multiple columns according to the specified option.
redo( )
Goes back to the previous change.
reform( )
Converts the originalData of the DataList into the current data, and initializes the status of all rows (into R status).
removeAll( )
Removes all data of the DataList and returns the removed data as a one-dimensional array.
removeColumnFilter( col )
Removes filtering from the specified column.
removeColumnFilterAll( )
Removes filtering from all columns.
removeRange( startIdx , endIdx )
Removes the rows between startIdx and endIdx, and returns the data as a one-dimensional array.
removeRow( rowIndex )
Removes the row of the corresponding rowIdex, and returns the data as a one-dimensional array.
removeRows( rowIndexArr )
Removes multiple rows based on an index array, and returns the data as a two-dimensional array.
restore( )
Returns the data to the previous stage.
rowMoveDown( rowIndex )
Moves down the row of the corresponding rowIndex.
rowMoveUp( rowIndex )
Moves up the row of the corresponding rowIndex.
setArray( jsonData , append )
Sets the data of the one-dimensional array in the DataList according to the column order of columnInfo. (The row status is changed to the default status R.)
setBroadcast( flag , refresh )
Sets whether to broadcast the change of the dataList to the bound component.
setCellAllData( realRowIndex , colIndex , data )
Executes setCellData based on the rowIndex of the unfiltered data.
setCellData( rowIndex , colIndex , data )
Sets the data in the cell of the corresponding rowIndex and colIndex.
setColumnDefaultValue( colIndex , defaultValue )
Sets the defaultValue as the default value of the row of the corresponding colIndex.
setColumnFilter( filterOptions )
Applied filtering to the column of the corresponding colIndex.
setData( arr , append , columnArr , rowStatus )
Sets or appends the data in the one-dimensional array.
setJSON( jsonData , append )
Sets or appends the JSON data.
setMatchIgnoreCase( flag )
Sets the capital-sensitive status when calling APIs such as getMatchedJSON, getMatchedIndex, etc.
setRowArray( rowIndex , dataObj , overwrite )
Insert array data in the corresponding row.
setRowData( rowIndex , rowData , overwrite )
Sets single-row data to the row of the corresponding rowIndex.
setRowJSON( rowIndex , rowData , overwrite )
Sets single-row JSON data to the row of the corresponding rowIndex.
setRowNumData( flag )
Sets whether to add the number value of the row when the return data of the get API is JSON or XML.
setRowPosition( position , noEvent )
Sets the position of the row to select from the componenet bound with the DataList.
setRowXML( rowIndex , XML , overwrite )
Inserts single-row XML data to the row of the corresponding rowIndex.
setXML( xmlData , append )
Sets or appends the XML data.
sort( bodyColumnID , sortType )
orts a single columne. (For multiple columns, use multisort API.)
trigger( type , array )
Triggers events registered of the DataList.
unbind( type , function )
Dynamically removes the events of the DataList.
undeleteRow( rowIndex )
Undeletes (or cancels D or V status of) the row of the corresponding rowIndex, and returns to the previous status.
undoAll( )
Initializes the entire data (into originalData) and resets the row status (into R).
undoRow( rowIndex )
Changes the data and the status of the row of the corresponding rowIndex.

Property Detail

attributeMap
Relevant only when the DataType is XML. Name of the DataMap to define an additional attribute in the rootNode. The key and the value of the DataMap will be defined as the attribute name and the attribute value of the rootNode.
baseNode
[default:list] Relevant only when the DataType is XML. Specify the XPath to define as the root node when converting the data into XML.
getMatchedFromAllData
[default:false, true]
true: Matches the entire data although filtering is applied to the GridView through the use of useFilter="true" setting.
false (Default): Matches the filtered data.
Reated APIs: getMatchedIndex, getMatchedData, getMatchedArray, getMatchedJSON, getMatchedXML
id
DataList ID.
Allocated as a global object. Used as a key to identify data in submissions and APIs.
idAttribute
Relevant only when the DataType is XML. Uses the DataList ID as a separate attribute (to be defined here).
initRowPosition
Index of the row to set as rowPosition when creating a dataList
matchIgnoreCase
[default:false] Sets capital-sensitive status when calling APIs such as getMatchedJSON, getMatchedIndex, etc.
removedDataMatch
Keeps a separate structure for the data returned by getModifiedXML, getDeleteXML, getVoidXML, or getOnlyDeleteXML with the XML structure being removed. False is to keep a separate structure. True is recommended for lower compatibility.
removeDummyRowStatus
Manages the data of which status has changed from C to E (by removeRow API). Valid when the saveRemovedData is true. When the removeDummyRowStatus is true, data modified by insertRow and removeRow will not be managed.
repeatNode
[default:map] Relevant only when the DataType is XML. Specifies the XPath of the node for the repeated data upon data conversion into XML.
rowNumData
[default:false] Whether to return the data by allocating row order (index +1) as the rowNum (key) or not.
rowStatusNodeName
Sets the name of the rowStatus key (node) when getting the data in JSON or XML format. The default is rowStatus.
saveRemovedData
Saves the data of which status is E (removed data by removeRow API).
undoRecursiveRow
Executes the undoRow on the row of the specified rowIndex as well as all child rows in the drilldown column.
userData1
User-defined property. Use getUserData("userData3") to get the data. // Example getUserData("userData1");
userData2
User-defined property. Use getUserData("userData2") to get the data. // Example getUserData("userData2");
userData3
User-defined property. Use getUserData("userData3") to get the data. // Example getUserData("userData3");
validateAllItemsetData
[default:false, true] Validates all data even when the dataList is bound a certain itemset and the data is filtered.
(ex) The selectbox is bound with dataList1, and the values of dataList1 is [1,2,3,4]. Apply filtering. When the result is [1,2], execute selectbox1.setValue("3"). The data existed before “3” is filtered. This option judges the data valid.
Affected when the dataList is bound with the itemsets of SelectBox and AutoComplete.
valueAttribute
Relevant only when the DataType is XML. Allocates the actual data to the attribute.

Event Detail

onaftercolumnfilterchange
Triggered after the filter applied to the column is changed.
Sample
<script ev:event="onaftercolumnfilterchange"><![CDATA[ alert("onaftercolumnfilterchange = " + this.getRowCount()); ]]></script>
onbeforecelldatachange
Triggered right before the data of a cell is changed. The developer can decide whether to apply the new data to the DataList or not.
If the event handler returns false, data change in the cell will be cancelled. Othewise, the new data will be applied.
Parameter
nametypedescription
infoJSONJSON containing rowIndex, colID, oldValue, and newValue <String> info.oldValue : Old value <String> info.newValue : New value <Number> info.rowIndex : Row index of the cell where the event occurred. <Number> info.colID : Row index of the cell where the event occurred.
Sample
<script ev:event="onbeforecelldatachange( info )"><![CDATA[ var rowIndex = info.rowIndex; var colID = info.colID; var oldValue = info.oldValue; var newValue = info.newValue; //cell의 data 변경을 중지하고 싶은 경우 아래와 같이 return false를 적용한다. //return false; ]]></script>
onbeforecolumnfilterchange
Triggered right before the filter applied to the column is changed by the end user.
Sample
<script ev:event="onbeforecolumnfilterchange"><![CDATA[ alert("onbeforecolumnfilterchange = " + this.getRowCount()); ]]></script>
onbeforerowpositionchange
Triggered right before the rowPosition of the DataList changes. The developer can decide whether to apply the new rowPosition or not.
If the event handler returns false, the rowPosition will be unchanged and the binding of the component with the DataList will be also canceled. For other returns, the rowPosition will be changed.
Parameter
nametypedescription
infoJSONJSON containing oldRowIndex, and newRowIndex <Number> info.oldRowIndex : Old row position. When filtered, the row position in the filtered status will be returned. <Number> info.newRowIndex : New row position. When filtered, the row position in the filtered status will be returned.
Sample
<script ev:event="onbeforerowpositionchange( info )"><![CDATA[ var oldRowIndex = info.oldRowIndex; var newRowIndex = info.newRowIndex; var oldRowData = this.getRowData(oldRowIndex); //row의 position을 변경하지 않을 경우 아래와 같이 return fasle를 적용한다. //return false; ]]></script>
oncelldatachange
Triggered when the data of a single cell is changed. Not generated upon changes in the entire DataList structure (through the use of setJSON and so on).
Not triggered when data change occurs in multiple cells at the same time by insertJSON, setRowData, or similar API. In this case, oninsertrow event will be triggered.
Parameter
nametypedescription
infoJSON:YJSON containing rowIndex, colID, oldValue, and newValue <String> info.oldValue : Old value <String> info.newValue : New value <Number> info.rowIndex : Row index of of the event-triggered cell <Number> info.colID : Row index of the cell where the event occurred.
Sample
<script ev:event="oncelldatachange( info )"><![CDATA[ var rowIndex = info.rowIndex; var colID = info.colID; var oldValue = info.oldValue; var newValue = info.newValue; // logic ]]></script>
ondataload
Triggered when the entire data of the DataList is set. The event is triggered after the data is set.
Relevant for APIs such as setJSON, setXML, and setData. (Also triggered when data is appended.)
However, calling removeAll will not trigger this event. In this case, onremoverow event will be triggered.
Sample
<script ev:event="ondataload"><![CDATA[ alert ("dataList에 데이터 설정이 완료되었습니다."); ]]></script>
oninsertrow
Triggered after a new row is added to the DataList. Although multiple rows are added at the same time, the event will occur only once.
Relevant APIs - insertRow, insertData, insertJSON, insertXML
Calling setJSON API for data appending will not trigger this event. Instead, ondataload will be triggered. (Data appending is different from insertRow.)
Parameter
nametypedescription
infoJSONReturns an object including insertedDataObj. <JSON> info.insertedDataObj : JSON containing indices and data of the added rows. The indexStirng of the row is the key. The index is where the row is actually inserted. However, the value allocated to the key is the row data in a one-dimensional array.
Sample
<script ev:event="oninsertrow( info )"><![CDATA[ var insertedDataObj = info.insertedDataObj; var insertedRowList = []; // insert된 row 집합 var insertedDataArr = []; // insert된 data 전체 집합. for(var insertedRow in insertedDataObj){ insertedRowList.push(insertedRow); insertedDataArr.concat(insertedDataObj[insertedRow]); } ]]></script> // Insert a single row using insertRow. dataList1.insertRow(0); // info object of the oninsertrow event { "insertedDataObj": { "0": [ "", "", "0", "" ] } } // Insert multiple rows using insertJSON. dataList1.insertJSON( 0, [{"name":"Chris","birthday":"19930516"},{"name":"John","birthday":"19780207"}] ); // info object of the oninsertrow event { "insertedDataObj": { "0": [ "Chris", "19930516", "0", "" ], "1": [ "John", "19780207", "0", "" ] } }
onremoverow
Triggered when a row is removed from the DataList. Triggered when removeRow, removeRows, removeRange, or removeAll API is called.
Although multiple rows are removed simultaneously, the event will be triggered only once. Changing of the entired data by setJSON will not trigger the event. Instead, ondataload event will be triggered.
Calling a method that changes only the status such as deleteRow does not trigger the event.
Parameter
nametypedescription
infoJSONReturns an object including removedDataObj. removedDataObj has {removedRow : removed dataArr} format. <Array> info.removedDataObj : Returns the removed rows and data as an object in the format of {deletedRowIndex1 : deletedData1, deletedRowIndex2 : deletedData2, ...}
Sample
<script ev:event="onremoverow( info )"><![CDATA[ var removedDataObj = info.removedDataObj; var removedRowList = []; // remove된 row 집합 var removedDataArr = []; // remove된 data 전체 집합. for(var removedRow in removedDataObj){ removedRowList.push(removedRow); removedDataArr.concat(removedDataObj[removedRow]); } ]]></script> // Remove a single row using removeRow. dataList1.removeRow(1); // info object of onremoverow event { "removedDataObj": { "1": [ "Chris", "19930516", "0", "" ] } } // Remove multiple rows using removeRows. dataList1.removeRows([1,2]); // info object of onremoverow event { "removedDataObj": { "1": [ "Chris", "19930516", "0", "" ], "2": [ "John", "19780207", "0", "" ] } }
onrowpositionchange
Triggered when the rowPosition of the DataList changes.
Parameter
nametypedescription
infoJSONJSON containing oldRowIndex, and newRowIndex <Number> info.oldRowIndex : Old row position. When filtered, the row position in the filtered status will be returned. <Number> info.newRowIndex : New row position. When filtered, the row position in the filtered status will be returned.
Sample
<script ev:event="onrowpositionchange( info )"><![CDATA[ var oldRowIndex = info.oldRowIndex; var newRowIndex = info.newRowIndex; ]]></script>

Method Detail

bind( eventType , function )
Dynamically allocates the events of the DataList.
Parameter
nametyperequireddescription
eventTypeStringYName of the event
functionFunctionYHandler function of the event
Sample
// ID of the DataList is dataList1. dataList1.bind("onsetdata", function(e){ alert("date setting");}); // Define the event function with commObj.fn_dcDataChage. dataList1.bind("oncelldatachange", commObj.fn_dcDataChage );
clearFilter( )
Clears all currently-applied filters in the dataList. (Related Function) setColumnFilter (Sets filtering for each column.)
Sample
// Filter the “dept” column with IT in the GridView. // Rows of which value is IT in the “dept” column will be displayed on the GridView. dataList1.setColumnFilter( {type:'row', colIndex:'dept', key:"IT", condition:'and'}); // Unfilters. // All rows of the “dept” column will be displayed on the GridView. dataList1.clearFilter();
clearSort( )
Cancels data sorting as well as sorting in the GridView component.
Sample
dataList1.clearSort();// Cancel sorting.
deleteRow( rowIndex )
Change the rowStatus of the first row into deleted status(D).
Parameter
nametyperequireddescription
rowIndexNumberYIndex of the row to delete
Sample
// Change the rowStatus of the first row into deleted status(D). (rowStatus: "D") dataList1.deleteRow(0);
deleteRows( rowIndexArr )
Changes the status of multiple rows of the specified indices into “D” simultaneously and returns the data of the deleted rows in a two-dimensional form.
Parameter
nametyperequireddescription
rowIndexArrArrayYArray of the indices of the rows to delete
Return
typedescription
ArrayTwo-dimensional array data of the removed rows
Sample
// Define "dept" and "name" columns in the DataList. // Delete fourth and fifth rows. var rsData = dataList1.deleteRows([3,4]) // (Return Example) [["HR","Kay"],["HR","Roy"]]
getAllArray( )
Converts the entire DataList data into column information and a one-dimensional array, and returns in JSON format.
Return
typedescription
JSONJSON containing column information and the data
<Array> columnInfo : Array containing column information. <Array> data : One-dimensional array containing the data.
Sample
// The DataList has two columns of name and addr. var returnJSONArr = dataList1.getAllArray(); // (Return Example) - Convert into string. { "columnInfo":["name","addr"] , "data":["Sammy","Seoul","Kay","Seoul","Roy","Seoul"] }
getAllData( )
Returns the entire data of the DataList as a one-dimensional array.
Related API: getAllFilteredData (Returns the entire filtered data.)
Return
typedescription
ArrayOne-dimensional array containing the data
Sample
// The DataList has two columns of name and addr. var returnArr = dataList1.getAllData(); // (Return Example) ["Sammy","Seoul","Kay","Seoul","Roy","Seoul"]
getAllFilteredData( )
Returns the entire filtered data as an array.
Related API: getAllData (Returns the entire data not filtered.)
Return
typedescription
ArrayEntire filtered data
getAllFilteredJSON( )
Returns the entire filtered data as JSON data.
Related API: getAllJSON (Returns all data not filtered.)
Return
typedescription
ArrayEntire filtered data
getAllFilteredXML( )
Returns the entire filtered data as XML data.
Related API: getAllXML (Returns all data not filtered.)
Return
typedescription
XMLEntire filtered data
getAllJSON( )
Converts single-row data of the DataList into JSON, and returns the entire data as a one-dimensional array.
Related API: getAllFilteredJSON (Returns the entire filtered data.)
Return
typedescription
ArrayOne-dimensional array containing JSON
Sample
// The DataList has two columns of name and addr. var rsData = dataList1.getAllJSON()); // (Return Example) - Convert into string. [ {name:"Sammy" ,addr:"Seoul"} , {name:"Kay" ,addr:"Seoul"} , {name:"Roy" ,addr:"Seoul"} ]
getAllXML( )
Returns the entire data of the DataList in XML.
Related API: getAllFilteredXML (Returns the entire data not filtered.)
Return
typedescription
XMLXML containing the entire data
Sample
// The DataList has two columns of name and addr. var returnXMLStr = dataList1.getAllXML(); // XML attributes of the DataList (such as baseNode and repeatNode) are not specified. // (Return Example) - Convert into string. <list id="dataList1"> <map index="0"> <addr>Seoul</addr> <name>Sammy</name> <rowStatus statusValue="0">R</rowStatus> </map> <map index="1"> <addr>Seoul</addr> <name>Kay</name> <rowStatus statusValue="1">U</rowStatus> </map> <map index="2"> <addr>Seoul</addr> <name>Roy</name> <rowStatus statusValue="0">R</rowStatus> </map> </list>
getCellAllData( realRowIndex , colInfo )
Executes getCellData based on the rowIndex of the unfiltered data.
Parameter
nametyperequireddescription
realRowIndexNumberYrowIndex of the unfiltered data
colInfoNumber||StringYColumn index or ID of the cell
Return
typedescription
StringCell data
Sample
// When rows 1 and 2 are filtered and hidden. var retVal1 = dataList1.getCellData(3,"name"); // Gets the value of the fifth row in the name column of the dataList. var retVal2 = dataList1.getCellAllData(3, "name"); // Gets the value of the third row in the name column of the dataList.
getCellData( rowIndex , colInfo )
Returns the data of the cell of the corresponding row index and the column index or ID.
Parameter
nametyperequireddescription
rowIndexNumberYRow index of the cell
colInfoNumber||StringYColumn index or ID of the cell
Return
typedescription
StringCell data
Sample
// Returns the data of the "name" column on the first row. var returnValue = dataList1.getCellData(0, "name");
getColData( colInfo )
Returns the data of the rows of the corresponding column index or ID as an array (without filtering or sorting).
Related API: getFilteredColData (Returns filtered or sorted column data.)
Parameter
nametyperequireddescription
colInfoNumber||StringYColumn index or ID of the cell
Return
typedescription
ArrayOne-dimensional array containing row column data
Sample
var returnArr = dataList1.getColData('name'); // Data array of the name column. // (Return Example) [ "Sammy" , "Kay" , "Roy" ]
getColumnDistinctDataArray( column )
Remove the overlapping data in the column of the specified index or ID and returns the data array sorted in the ascending powers.
Parameter
nametyperequireddescription
columnNumber||StringYColumn index or ID
Return
typedescription
ArrayColumn data with overlapping data being removed
getColumnID( colIndex )
Receives the index of the column, and returns the ID of the corresponding column.
Parameter
nametyperequireddescription
colIndexNumberYColumn index defined in the DataList
Return
typedescription
StringColumn ID
Sample
// DataList Example <w2:dataList id="dataList1"> <w2:columnInfo> <w2:column id="addr" name="주소" dataType="text"></w2:column> <w2:column id="name" name="이름" dataType="text"></w2:column> </w2:columnInfo> </w2:dataList> var colID = dataList1.getColumnID(0); // (Return Example) "addr"
getColumnIndex( colID )
Receives the ID of the column, and returns the index of the corresponding column.
Parameter
nametyperequireddescription
colIDStringYGrid column ID
Return
typedescription
NumberGrid column index
Sample
// DataList Example <w2:dataList id="dataList1"> <w2:columnInfo> <w2:column id="addr" name="주소" dataType="text"></w2:column> <w2:column id="name" name="이름" dataType="text"></w2:column> </w2:columnInfo> </w2:dataList> var colIdx = dataList1.getColumnIndex("name"); // (Return Example) 1
getColumnInfo( columnID )
Gets details of a certain column on the DataList.
Parameter
nametyperequireddescription
columnIDStringYColumn ID to get the details
Return
typedescription
JSONJSON object containing attributes of the column
Sample
dataList1.getColumnInfo("column2");
getColumnName( columnInfo )
Receives the index or ID of the column, and returns the name of the corresponding column.
Parameter
nametyperequireddescription
columnInfoString||NumberYColumn ID or index
Return
typedescription
StringColumn name
Sample
// DataList Example <w2:dataList id="dataList1"> <w2:columnInfo> <w2:column id="addr" name="주소" dataType="text"></w2:column> <w2:column id="name" name="이름" dataType="text"></w2:column> </w2:columnInfo> </w2:dataList> var colName = dataList1.getColumnName("name"); // (Return Example) "Name"
getDataRow( rowIndex )
Returns the data of the row of the corresponding row index in hash format in which the column ID is used as the key.
Parameter
nametyperequireddescription
rowIndexNumberYIndex of the row to get the data
Return
typedescription
ObjectHash-type object in the row of the corresponding rowIndex
Sample
// DataList Example <w2:dataList id="dataList1"> <w2:columnInfo> <w2:column id="addr" name="주소" dataType="text"></w2:column> <w2:column id="name" name="이름" dataType="text"></w2:column> </w2:columnInfo> <w2:data xmlns="" use="true"> <w2:row> <addr><![CDATA[서울]]></addr> <name><![CDATA[손예진]]></name> </w2:row> <w2:row> <addr><![CDATA[서울]]></addr> <name><![CDATA[류승룡]]></name> </w2:row> </w2:data> </w2:dataList> var rowData = dataList1.getDataRow(1); var tmpName = rowData.name; // (Return Example) "Roy" var tmpAddr = rowData.addr; // (Return Example) "Seoul" // Check the entire data of the row. for(var tmpKeyNm in rowData){ $p.log( tmpKeyNm + ' : ' + rowData[tmpKeyNm] ); } // (Display Example) name : Roy addr : Seoul
getDeletedArray( )
Deleted status. JSON that has information about the rows in deleted, removed, or inserted and deleted status (such as D, E, or V).
Return
typedescription
JSONJSON containing information about the rows in deleted status
<Array> columnInfo : An array of column IDs <Array> data : One-dimensional array of the cell data in the order of the columInfo ID
Sample
var rsData = dataList1.getDeletedArray(); // (Return Example) { "columnInfo": [ "addr", "name" ], "data": [ "Seoul", "Samuel", "Seoul", "Gina" ] }
getDeletedData( )
A two-dimensional array of the rows in deleted, removed, or inserted and deleted status (such as D, E, or V)
Return
typedescription
ArrayTwo-dimensional data array of the rows in deleted status.
Sample
var rsData = dataList1.getDeletedArray(); // (Return Example) [[ "Seoul" , "Samuel" ],[ "Seoul" , "Gina" ]]
getDeletedIndex( )
Returns the indices of the rows in deleted status (such as D, V, 3, or 4) as an array. (Rows in E status deleted by remove API will not be returned.)
Return
typedescription
ArrayOne-dimensional array containing indices of the rows in deleted status (D, V, 3, 4.)
Sample
var returnArr = dataList1.getDeletedIndex(); // (Return Example) ) [0, 2]
getDeletedJSON( )
Converts the data of the rows in deleted, removed, or inserted and deleted status (such as D, E, or V) into JSON and returns as an array.
Return
typedescription
ArrayOne-dimensional array of JSON data of the rows in deleted status.
Sample
var rsData = dataList1.getDeletedJSON(); // (Return Example)) [ { "addr": "" , "name": "", "rowStatus": "V" } , { "addr": "Seoul", "name": "Sammy", "rowStatus": "D" } , { "addr": "Seoul", "name": "Samuel", "rowStatus": "E" } ]
getDeletedXML( )
Returns the data of the rows in deleted status (D, E, or V) as an XML.
Return
typedescription
XMLXML of the rows in deleted status.
Sample
var rsData = dataList1.getDeletedXML(); // (Return Example) <list id="dataList1"> <map index="0"> <addr></addr> <name></name> <rowStatus statusValue="4">V</rowStatus> </map> <map index="1"> <addr>Seoul</addr> <name>Sammy</name> <rowStatus statusValue="3">D</rowStatus> </map> <map index="removed"> <addr>Seoul</addr> <name>Samuel</name> <rowStatus statusValue="5">E</rowStatus> </map> </list>
getFilteredColData( colInfo )
Returns the filtered or sorted data as JSON data. (Related Function) Related API: getColData (Returns the entired entire data not filtered nor sorted.)</div> <!--만일 해당 Method 가 파라미터가 있는 경우 table 테그를 이용해서 보여준다.--> <table id="ptable"> <caption>Parameter</caption> <tr> <td class="header1">name</td><td class="header2">type</td><td class="header2">required</td><td class="header3">description</td> </tr> <tr> <td class="necessary">colInfo</td><td class="row">Number||String</td><td class="row">Y</td><td class="row">Column index or ID of the cell</td> </tr> </table> <!--만일 해당 Method 에 return 값이 있는 경우 table 테그를 이용해서 보여준다.--> <table id="ptable"> <caption>Return</caption> <tr> <td class="header1">type</td><td class="header2">description</td> </tr> <tr> <td class="row">Array</td><td class="row">1-dimensional array containing the column data (Filterd or sorted data)</td> </tr> </table> <div class="caption_sample">Sample</div> <div class="pdesc"><xmp class='js sample'>var returnArr = dataList1.getFilteredColData('name'); // Data array of the name column. // (Return) [ "Apple" , "Banana"] ("Orange" has been filtered, hence, not displayed.)
getFilteredRowIndex( realRowIndex )
Returns the index of the row that has been filtered.
Parameter
nametyperequireddescription
realRowIndexNumberYIndex of the row that is not being filtered.
Return
typedescription
NumberIndex of the row that has been filtered.
getFilterList( )
Returns the filtering status of each column in the filtered DataList. (Related Function) setColumnFilter (Useful when returning to the previous filtering status after saving the filtering status and canceling filtering.)
Return
typedescription
ArrayObject containing filters applied to the DataList as an array
Sample
var currentFilter = dataList1.getFilterList(); // Save the current filtering status. dataList1.clearFilter(); // Clear filtering. for(var i = 0; i &lt; currentFilter.length; i++) {dataList1.setColumnFilter(currentFilter[i]);} // Returns to the previous filtering status. // Or, // In case of UseFilterList = "true" and useFilterListSync = "true", // use the following example to go back to the previous filtering status. for(var i = 0; i &lt; currentFilter.length; i++) {dataList1.setColumnFilter ( {type: currentFilter[i].type, colIndex: currentFilter[i].colIndex, key: currentFilter[i].key, condition: currentFilter[i].condition, exactMatch: true});}
getFusionChartData( chartType , labelNode , seriesColumns )
Returns the DataList as JSON data for the FusionChart component.
Parameter
nametyperequireddescription
chartTypeStringYType of the chart
labelNodeStringY"Column ID in the DataColleciton to be used as the label in the chart
seriesColumnsStringYColumn information in the DataCollection to be used as the series data in the chart. Array-type string.
Return
typedescription
JSONConverted FusionChart data (JSON)
Sample
// The DataList is as shown below. <w2:dataList id="dc_chart" baseNode="list" style="" repeatNode="map" valueAttribute=""> <w2:columnInfo> <w2:column id="category1" name="대분류" dataType="text"></w2:column> <w2:column id="category2" name="중분류" dataType="text"></w2:column> <w2:column id="row3_1" name="row3_1" dataType="text"></w2:column> <w2:column id="row3_2" name="row3_2" dataType="text"></w2:column> </w2:columnInfo> <w2:data xmlns="" use="true"> <w2:row> <category1><![CDATA[소설]]></category1> <category2><![CDATA[한국소설]]></category2> <row3_1><![CDATA[100]]></row3_1> <row3_2><![CDATA[200]]></row3_2> </w2:row> <w2:row> <category1><![CDATA[소설]]></category1> <category2><![CDATA[영미소설]]></category2> <row3_1><![CDATA[100]]></row3_1> <row3_2><![CDATA[400]]></row3_2> </w2:row> <w2:row> <category1><![CDATA[시/에세이]]></category1> <category2><![CDATA[에세이]]></category2> <row3_1><![CDATA[400]]></row3_1> <row3_2><![CDATA[100]]></row3_2> </w2:row> <w2:row> <category1><![CDATA[시/에세이]]></category1> <category2><![CDATA[시]]></category2> <row3_1><![CDATA[200]]></row3_1> <row3_2><![CDATA[500]]></row3_2> </w2:row> </w2:data> </w2:dataList> var rsData = dc_chart.getFusionChartData("MSColumn2D","category2","[['row3_1','row3_2']]"); // (Return Example)) { "categories": [ { "category": [ { "label": "Koren Novel" }, { "label": "English Novel" }, { "label": "Non-fiction" }, { "label": "Poem" } ] } ], "dataset": [ { "data": [ { "value": "100" }, { "value": "100" }, { "value": "400" }, { "value": "200" } ], "seriesname": "row3_1" }, { "data": [ { "value": "200" }, { "value": "400" }, { "value": "100" }, { "value": "500" } ], "seriesname": "row3_2" } ] }
getFusionChartSimpleData( chartType , labelNode , seriesNode , valueNode )
Converts the DataList data into JSON data for FusionChart singleSeries and multiSeries in the simple mode.
Parameter
nametyperequireddescription
chartTypeStringYType of the chart
labelNodeStringYColumn ID in the DataList to be used as the label in the chart
seriesNodeStringYColumn ID in the DataList to be used as the series data in the chart
valueNodeStringYColumn ID in the DataList to be used as the value in the chart
Return
typedescription
JSONFusionChart data converted into fusionChart_DataJSON. Different data forms exist for singleSeries and multiSeries. See the example.
Sample
// Define a DataList. <w2:dataList id="dc_chart" baseNode="list" style="" repeatNode="map"> <w2:columnInfo> <w2:column id="series" name="series" dataType="text"></w2:column> <w2:column id="label" name="label" dataType="text"></w2:column> <w2:column id="value" name="value" dataType="number"></w2:column> </w2:columnInfo> <w2:data use="true"> <w2:row> <series><![CDATA[상반기]]></series> <label><![CDATA[2013]]></label> <value><![CDATA[390]]></value> </w2:row> <w2:row> <series><![CDATA[하반기]]></series> <label><![CDATA[2013]]></label> <value><![CDATA[440]]></value> </w2:row> <w2:row> <series><![CDATA[상반기]]></series> <label><![CDATA[2014]]></label> <value><![CDATA[420]]></value> </w2:row> <w2:row> <series><![CDATA[하반기]]></series> <label><![CDATA[2014]]></label> <value><![CDATA[450]]></value> </w2:row> </w2:data> </w2:dataList> // For singleSerise chart var tmpChartData = dc_chart.getFusionChartSimpleData("column2D","label","series","value"); // (Return Example) { "data": [ { "label": "2013", "value": "390" }, { "label": "2013", "value": "440" }, { "label": "2014", "value": "420" }, { "label": "2014", "value": "450" } ] } multiSeries chart var tmpChartData2 = dc_chart.getFusionChartSimpleData("MSColumn2D","label","series","value"); // (Return Example) { "categories": [ { "category": [ { "label": "2013" }, { "label": "2014" } ] } ], "dataset": [ { "data": [ { "value": "390" }, { "value": "420" } ], "seriesname": "1H" }, { "data": [ { "value": "440" }, { "value": "450" } ], "seriesname": "2H" } ] }
getID( )
Gets the ID of the DataList object. Same as the object ID.
Return
typedescription
StringGets the ID of the DataList object.
getInfo( )
Gets details of the DataList.
Return
typedescription
JSON{dataListInfo : attribute, columnInfo : Object of column attributes}
Sample
dataList1.getInfo();
getInsertedArray( )
Gets JSON data that includes rows in inserted (or C) status.
Return
typedescription
JSONJSON data that includes rows in inserted (or C) status
<Array> columnInfo : An array of column IDs <Array> data : One-dimensional array of the cell data in the order of the columInfo ID
Sample
var rsData = dataList1.getInsertedArray(); // (Return Example) { "columnInfo": [ "addr", "name" ], "data": [ "Seoul", "New" ] }
getInsertedData( )
Two-dimensional array that contains the data of the rows that is in inserted (or C) status.
Return
typedescription
ArrayTwo-dimensional array that contains the data of the rows that is in Inserted status
Sample
var rsData = dataList1.getInsertedData(); // (Return Example) [ [ "Seoul" , "New1" ] , [ "Seoul" , "New2" ] ]
getInsertedIndex( )
Returns the indices of the rows in inserted (or C) status as an array.
Return
typedescription
ArrayAn array of the index data of the rows in Inserted status.
Sample
var rsData = dataList1.getInsertedIndex(); // (Return Example) [ 0 , 2 ]
getInsertedJSON( )
Converts the data of the rows in Inserted status (or C) into JSON and returns them as an array.
Return
typedescription
ArrayOne-dimensional array of JSON data of the rows in Inserted status
Sample
var rsData = dataList1.getInsertedJSON()); // (Return Example)) [ { "addr": "Seoul" , "name": "Sammy", "rowStatus": "C" } , { "addr": "Seoul", "name": "Anonymous1", "rowStatus": "C" } ]
getInsertedXML( )
Converts the data of the rows in Inserted status (or C) as an XML.
Return
typedescription
XMLXML of the rows in Inserted status
Sample
var rsData = dataList1.getInsertedXML(); // (Return Example) <list id="dataList1"> <map index="0"> <addr>Unknown</addr> <name>Anonymous1</name> <rowStatus statusValue="2">C</rowStatus> </map> <map index="2"> <addr>Seoul</addr> <name>Kay</name> <rowStatus statusValue="2">C</rowStatus> </map> </list>
getMatchedArray( colInfo , dataValue , exactMatch , stRowIndex , lastRowIndex )
Returns the JSON data of the rows of which colInfo is dataValue among the rows between stRowIndex and lastRowIndex.
Parameter
nametyperequireddescription
colInfoNumber||StringYIndex or ID of the column to check the data
dataValueStringYData to compare with the data of the row of the corresponding colInfo
exactMatchBooleanN[default:true, false] Whether they exactly match or not.
stRowIndexNumberNFirst row index to get the data
lastRowIndexNumberNLast row index to get the data
Return
typedescription
JOSNJSON that contains the data of the specified range
<Array> columnInfo One-dimensional array of the column IDs <Array> data One-dimensional array of the result
Sample
var tmpRsData = dataList1.getMatchedArray("dept","HR"); // (Return Example) { "columnInfo":["dept","name"] ,"data":["HR","Sammy","HR","Roy"] }
getMatchedColumnData( matchCol , dataValue , targetCol , exactMatch , stRowIndex , lastRowIndex )
Returns the data of the rows of which matchCol is dataValue among the rows between stRowIndex and lastRowIndex as a one-dimensional array.
Parameter
nametyperequireddescription
matchColNumber||StringYIndex or ID of the column to check the data
dataValueStringYData to compare with matchCol data
targetColNumber||StringYIndex or ID of the column to get the data
exactMatchBooleanN[default:true, false] Whether they exactly match or not
stRowIndexNumberNFirst row index to get the data
lastRowIndexNumberNLast row index to get the data
Return
typedescription
ArrayOne-dimensional array containing the data of the targetCol.
Sample
var tmpRsData =dataList1.getMatchedColumnData("dept","HR","name"); // (Return Example)["Sammy" , "Roy"]
getMatchedData( colInfo , dataValue , exactMatch , stRowIndex , lastRowIndex )
Returns the data of the rows of which colInfo is dataValue among the rows between stRowIndex and lastRowIndex as a two-dimensional array.
Parameter
nametyperequireddescription
colInfoNumber||StringYIndex or ID of the column to check the data
dataValueStringYData to compare with the data of the row of corresponding colIndex
exactMatchBooleanNWhether they exactly match or not
stRowIndexNumberNFirst row index to get the data
lastRowIndexNumberNLast row index to get the data
Return
typedescription
ArrayTwo-dimensional array of the searched rows
Sample
var tmpRsData = dataList1.getMatchedData("dept","HR"); // (Return Example) [["HR","Sammy"],["HR","Roy"]]
getMatchedIndex( conInfo , dataValue , exactMatch , stRowIndex , lastRowIndex )
Returns the indices the rows of which colInfo is dataValue among the rows between stRowIndex and lastRowIndex.
Parameter
nametyperequireddescription
conInfoNumber||StringYIndex or ID of the column to check the data
dataValueStringYData to compare with the data of the column of corresponding conInfo
exactMatchBooleanN[default:true, false] Whether they exactly match or not
stRowIndexNumberNFirst row index to get the data
lastRowIndexNumberNLast row index to get the data
Return
typedescription
ArrayOne-dimensional array containing the matching index within the specified range
Sample
var tmpRsData = dataList1.getMatchedIndex("dept","HR"); // (Return Example) [0,3]
getMatchedJSON( colInfo , dataValue , exactMatch , stRowIndex , lastRowIndex )
Returns the JSON data of the rows of which colInfo is dataValue among the rows between stRowIndex and lastRowIndex as an array.
Parameter
nametyperequireddescription
colInfoNumber||StringYIndex or ID of the column to check the data
dataValueStringYData to compare with the data of the row of the corresponding colInfo
exactMatchBooleanN[default:true, false] Whether they exactly match or not
stRowIndexNumberNIndex of the first row
lastRowIndexNumberNIndex of the last row
Return
typedescription
ArrayOne-dimensional array with JSON data within the specified range
Sample
// Return the data of the row that has "HR" in dept column as a JSON array. var tmpRsData = dataList1.getMatchedJSON("dept","HR"); // (Return Example) [{"dept":"HR","name":"Sammy","rowStatus":"R"},{"dept":"HR","name":"Roy","rowStatus":"R"}]
getMatchedXML( colInfo , dataValue , exactMatch , stRowIndex , lastRowIndex )
Returns the data of the rows of which colInfo is dataValue among the rows between stRowIndex and lastRowIndex as an XML.
Parameter
nametyperequireddescription
colInfoNumber||StringYIndex or ID of the column to check the data
dataValueStringYData to compare with the data of the row of the corresponding colInfo
exactMatchBooleanN[default:true, false] Whether they exactly match or not
stRowIndexNumberNFirst row index to get the data
lastRowIndexNumberNLast row index to get the data
Return
typedescription
XMLXML data within the specified range
Sample
var tmpRsData = dataList1.getMatchedXML("dept","HR"); // (Return Example) <list id="dataList1"> <map index="0"> <dept>HR</dept> <name>Sammy</name> <rowStatus statusValue="0">R</rowStatus> </map> <map index="3"> <dept>HR</dept> <name>Roy</name> <rowStatus statusValue="0">R</rowStatus> </map> </list>
getModifiedArray( )
Gets the rows which are in a modified status (C, U, D, or E) as JSON.
Return
typedescription
JSONJSON of the rows in modified status
<Array> columnInfo : An array of column IDs <Array> data : One-dimensional array of the cell data in the order of the columInfo ID
Sample
var tmpRsData = dataList1.getModifiedArray() // (Return Example) { "columnInfo": [ "dept", "name" ] , "data": [ "Not Defined", "Row Added", "HR", "Changed", "PR", "Samuel", "IT", "Gina" ] }
getModifiedData( )
Returns the data of the rows in a modified status such as (C, U, D or E) as an array.
Return
typedescription
ArrayTwo-dimensional array of the rows in modified status
Sample
var tmpRsData = dataList1.getModifiedData(); // (Return Example) [["","Row Added"],["HR","Row Modified"],["HR","Samuel"],["IT","Gina"]]
getModifiedIndex( )
Returns the indices of the rows in a modified status such as (C, U, or D) as an array.
Return
typedescription
ArrayOne-dimensional array of the index data of the rows in modifed status
Sample
var tmpRsData = dataList1.getModifiedIndex(); // (Return Example) [1,2,3]
getModifiedJSON( options )
Converts the data of the rows in updated, inserted, deleted, or removed status (U, C, D, E, 1, 2, 3, or 5) into JSON and returns them as a one-dimensional array.
Parameter
nametyperequireddescription
optionsJSONNSets the order of returning the data of the rows in upated, inserted, deleted, or removed rows.
<Boolean:N> options.DB : [default:false, true] The removed (E) row is first returned for the server to manage the data. <Boolean:N> options.saveRemovedData : [default:true, false] Set false to return the rows except the removed (E) row.
Return
typedescription
ArrayOne-dimensional array of the JSON data of the rows inserted, modified or removed.
Sample
var returnJSON1 = dataList1.getModifiedJSON(); // (Return Example) [ { "dept": "", "name": "", "rowStatus": "C" }, { "dept": "HR", "name": "Sammy", "rowStatus": "D" }, { "dept": "HR", "name": "Changed", "rowStatus": "U" }, { "dept": "HR", "name": "Samuel", "rowStatus": "E" } ] var returnJSON2 = dataList1.getModifiedJSON({saveRemovedData:false}); // (Return Example) [ { "dept": "", "name": "", "rowStatus": "C" }, { "dept": "HR", "name": "Sammy", "rowStatus": "D" }, { "dept": "HR", "name": "Changed", "rowStatus": "U" } ]
getModifiedXML( options )
Converts the data of the rows in updated, inserted, deleted, or removed status (U, C, D, E, 1, 2, 3, or 5) into an XML.
Parameter
nametyperequireddescription
optionsJSONNSet the data of the modified rows (inserted, updated, deleted, and removed).
<Boolean:N> options.saveRemovedData : default:true, false] Set false to return the rows except the removed (E) row.
Return
typedescription
XmlXML data of the rows inserted, updated, or deleted
Sample
var returnXML1 = dataList1.getModifiedXML(); // (Return Example) <list id="dataList1"> <map index="0"> <dept></dept> <name></name> <rowStatus statusValue="2">C</rowStatus> </map> <map index="1"> <dept>HR</dept> <name>Sammy</name> <rowStatus statusValue="3">D</rowStatus> </map> <map index="3"> <dept>HR</dept> <name>Changed</name> <rowStatus statusValue="1">U</rowStatus> </map> <map index="removed"> <dept>HR</dept> <name>Samuel</name> <rowStatus statusValue="5">E</rowStatus> </map> </list> var returnXML2 = dataList1.getModifiedXML({saveRemovedData:false}); // (Return Example) <list id="dataList1"> <map index="0"> <dept></dept> <name></name> <rowStatus statusValue="2">C</rowStatus> </map> <map index="1"> <dept>HR</dept> <name>Sammy</name> <rowStatus statusValue="3">D</rowStatus> </map> <map index="3"> <dept>HR</dept> <name>Changed</name> <rowStatus statusValue="1">U</rowStatus> </map> </list>
getObjectType( )
Returns the type of the DataCollection.
Return
typedescription
String[dataMap, dataList, linkedDataList] Returns the type of the DataCollection.
Sample
var dcType = dataList1.getObjectType(); (Return Example) "dataList"
getOnlyDeletedArray( )
Returns JSON data that contains information of the rows in deleted or removed status (D or E).
Return
typedescription
JSONJSON of the rows in deleted status
<Array> columnInfo : An array of column IDs <Array> data : One-dimensional array of the cell data in the order of the columInfo ID
Sample
var tmpRsData = dataList1.getOnlyDeletedArray(); // (Return Example) { "columnInfo": [ "addr", "name" ], "data": [ "Seoul", "Samuel", "Seoul", "Gina" ] }
getOnlyDeletedData( )
Returns the deleted or removed status (D or E) as a two-dimensional array.
Return
typedescription
ArrayArray of the row data in deleted status.
Sample
var tmpRsData = dataList1.getOnlyDeletedData(); // (Return Example) [["HR","Samuel"],["IT","Gina"]]
getOnlyDeletedIndex( )
Returns the indices of the rows in deleted status (D) as an array.
Return
typedescription
ArrayArray of the indices of the rows in deleted status
Sample
var tmpRsData = dataList1.getOnlyDeletedIndex(); // (Return Example) [3]
getOnlyDeletedJSON( )
Returns the JSON data of the rows in deleted or removed status (D or E) as an array.
Return
typedescription
ArrayArray of the JSON data of the rows in deleted status
Sample
var tmpRsData = dataList1.getOnlyDeletedJSON(); // (Return Example) [ {"dept":"HR","name":"Samuel","rowStatus":"D"} ,{"dept":"IT","name":"Gina","rowStatus":"E"} ]
getOnlyDeletedXML( )
Returns the data of the rows in deleted or removed status (D or E) as an XML.
Return
typedescription
XMLXML data of the rows in deleted status
Sample
var tmpRsData = dataList1.getOnlyDeletedXML() // (Return Example) <list id="dataList1"> <map index="3"> <dept>HR</dept> <name>Samuel</name> <rowStatus statusValue="3">D</rowStatus> </map> <map index="removed"> <dept>IT</dept> <name>Gina</name> <rowStatus statusValue="5">E</rowStatus> </map> </list>
getOption( attr )
Returns the attributes defined for the DataList.
Parameter
nametyperequireddescription
attrStringYName of the attribute
Return
typedescription
StringAttribute defined in the DataList
Sample
// DataList Example <w2:dataList id="dataList1" baseNode="list"> <w2:columnInfo> <w2:column id="dept" name="부서" dataType="text"></w2:column> <w2:column id="name" name="이름" dataType="text"></w2:column> </w2:columnInfo> </w2:dataList> var tmpAttr = dataList1.getOption("baseNode"); // (Return Example) "list"
getOriginalCellData( rowIndex , colIndex )
Returns the initial data of the cell of the corresponding rowIndex and the colInfo.
Parameter
nametyperequireddescription
rowIndexNumberYIndex of the initial row of the cell
colIndexString||NumberYID or index of the column
Return
typedescription
StringInitial data of the cell
Sample
var tmpRsData = dataList1.getOriginalCellData(0, "name");
getParentRowIndex( rowIndex )
Returns the rowIndex of the parent row when the drilldown is used.
Parameter
nametyperequireddescription
rowIndexNumberYNumber of the row to check the parent
Return
typedescription
NumberReturns the index of the parent row.
getRangeArray( fromIdx , toIdx )
Returns JSON that contains column information and data of the rows between fromIdx and toIdx.
Parameter
nametyperequireddescription
fromIdxNumberYIndex of the first row in the range to get the data from
toIdxNumberYIndex of the last row in the range to get the data from
Return
typedescription
JSONJSON that contains the data of the specified range
<Array> columnInfo One-dimensional array of the column IDs <Array> data One-dimensional array of the result
Sample
// Get the data of the rows from Index 0 to Index 2. var tmpRsData = dataList1.getRangeArray(0,2); // (Return Example) { "columnInfo":["dept","name"] ,"data":["HR","Sammy","HR","Samuel","IT","Gina"] }
getRangeData( from , to )
Returns the data of the rows in the specified range as a one-dimensional data.
Parameter
nametyperequireddescription
fromNumberYFirst row index to get the data
toNumberYLast row index to get the data
Return
typedescription
ArrayArray of the data within the specified range.
Sample
var tmpRsData = dataList1.getRangeData(0,2); // (Return Example) ["HR","Sammy","HR","Samuel","IT","Gina"]
getRangeJSON( from , to )
One-dimensional array containing JSON data of the rows within the specified range.
Parameter
nametyperequireddescription
fromNumberYIndex of the first row in the range to get the data from
toNumberYIndex of the last row in the range to get the data from
Return
typedescription
Array"Array of the JSON object of the rows within the specified range
Sample
// Convert the data of the first row to the third row into JSON, and return as an array. var tmpRsData = dataList1.getRangeJSON(0,2); // (Return Example) [ {"dept":"HR","name":"Sammy","rowStatus":"R"} ,{"dept":"HR","name":"Samuel","rowStatus":"R"} ,{"dept":"IT","name":"Gina","rowStatus":"R"} ]
getRangeXML( from , to )
Returns the data of the rows in the specified range as an XML.
Parameter
nametyperequireddescription
fromNumberYIndex of the first row in the range to get the data from
toNumberYIndex of the last row in the range to get the data from
Return
typedescription
XMLXML data of the rows within the specified range
Sample
var tmpRsData = dataList1.getRangeXML(0,2); // (Return Example) <list id="dataList1"> <map index="0"> <dept>HR</dept> <name>Sammy</name> <rowStatus statusValue="0">R</rowStatus> </map> <map index="1"> <dept>HR</dept> <name>Samuel</name> <rowStatus statusValue="0">R</rowStatus> </map> <map index="2"> <dept>IT</dept> <name>Gina</name> <rowStatus statusValue="0">R</rowStatus> </map> </list>
getRealRowIndex( )
Returns the actual row index.
Return
typedescription
NumberActual Row Index
getRecursiveRowIndex( )
Returns all rows under the row index as an array when the depthColumn is in use.
Return
typedescription
ArrayArray of all row indices under the given row index
getRowArray( rowIndex )
Returns JSON data that contains information of the row of the corresponding rowIndex.
Parameter
nametyperequireddescription
rowIndexNumberYIndex of the row to get the data from
Return
typedescription
JSONJSON of the row information
<Array> columnInfo One-dimensional array of the column IDs <Array> data One-dimensional array of the result
Sample
// Data object of the row of Index O var tmpRsData = dataList1.getRowArray(0); // (Return Example) { "columnInfo":["dept","name"] ,"data":["HR","Sammy"] }
getRowCount( )
Returns the number of the rows currently displayed. Filtered rows and the drilled-down rows on the gridView will not be counted.
For the total data row count, use getTotalRow API.
Return
typedescription
NumberRow count
Sample
var tmpRowCount = dataList1.getRowCount();
getRowData( rowIndex )
Returns the data or the rows of the corresponding rowIndex as an array.
Parameter
nametyperequireddescription
rowIndexNumberYIndex of the row to get the data from
Return
typedescription
ArrayData array of the specified row
Sample
// In the DataList, two columns of name and the birthday are defined. var rsData = dataList1.getRowData( 0 ); // (Return Example) ["Chris", "19930516"]
getRowIndexByStatus( statusStr )
Returns the indices of the rows of the corresponding status (or code).
No return will be made when the status code is E (resulted by a method such as removeRow).
In case there are multiple status codes, combine the codes (for example, "CU") and return as a parameter.
Parameter
nametyperequireddescription
statusStrStringY[C,U,D,V,R] Status codes in capital letters
Return
typedescription
ArrayArray of the index data of the rows in statusStr status.
Sample
// An array of rowIndex data of the rows in inserted, updated, or deleted status in dataList1. var returnArr = dataList1.getRowIndexByStatus('CUD'); // (Return Example) [1,3]
getRowJSON( rowIndex )
Returns the data of the row of the corresponding index as a JSON object.
Parameter
nametyperequireddescription
rowIndexNumberYIndex of the row to get the data from
Return
typedescription
JSONJSON object data of the corresponding row
Sample
// Two columns of name and the birthday are defined in the following DataList. var returnData = dataList1.getRowJSON(0); // (Return Example) {"name":"Chris","birthday":"19930516","rowStatus":"R"}
getRowPosition( )
Returns the current row index of the bound DataList.
Return
typedescription
Number:YrowPosition
Sample
// Bind gridView1 with dataList1, and click cell (3,2) of the gridview. dataList1.getRowPosition(); // The result of the above example must be 3. // Bind treeview2 with dataList2, and click the node of which index is 5. (node.index === 5) dataList1.getRowPosition(); // The result of the above example is 5.
getRowStatus( rowIndex )
Returns the status of the row of the corresponding rowIndex as a code. (Default:"R", Updated:"U", Inserted:"C", Deleted:"D", Inserted and Deleted:"V")
Parameter
nametyperequireddescription
rowIndexNumberYRow index
Return
typedescription
StringStatus code of the row (Default: "R", Updated: "U", Inserted: "C", Deleted: "D", Inserted and Deleted: "V")
Sample
var returnValue = dataList1.getRowStatus(0); // Return the rowStatus (string) of the first row. // (Return Example) "R"
getRowStatusValue( rowIndex )
Returns the status of the specified row. (Default: 0, Updated: 1, Inserted: 2, Deleted: 3, Inserted and Deleted: 4)
Parameter
nametyperequireddescription
rowIndexNumberYRow index
Return
typedescription
NumberStatus of the row (Default: 0, Updated: 1, Inserted: 2, Deleted: 3, Inserted and Deleted: 4)
Sample
var returnValue = dataList1.getRowStatusValue(0); // Return the rowStatus (code) of the first row. // (Return Example) 0
getRowXML( rowIndex )
Returns the data of the row of the corresponding rowIndex as an XML.
Parameter
nametyperequireddescription
rowIndexNumberYRow index
Return
typedescription
XMLXML data of the row
Sample
var rsData = dataList1.getRowXML(0); // (Return Example) <map index="0"> <name>John</name> <birthday>19780207</birthday> <rowStatus statusValue="0">R</rowStatus> </map>
getScope( )
Returns the parent WFrame object when the component is a child of the WFrame which uses the scope feature (scope=true). Returns null when the component is not a child of the WFrame using the scope feature (scope=true).
Return
typedescription
Objectwframe object or null
Sample
// The main page contains wframe1 which contains wframe11 bound with dataList1. dataList1.getScope(); // Returns wframe11 object.
getScopeWindow( )
Returns the scope object of the parent when the component is a child of the WFrame which uses the scope feature (scope=true). Returns a global window object when the component is not a child of the WFrame using the scope feature (scope=true.
Return
typedescription
ObjectScope object of the wframe object, or a global window object
Sample
// The main page contains wframe1 which contains wframe11 bound with dataList1. var scope = dataList1.getScopeWindow(); scope.wframe11 === dataList1.getScope(); // true
getTotalCol( )
Returns the number of the columns defined in the DataList.
Return
typedescription
NumberNumber of columns in the DataList
getTotalRow( )
Returns the total number of the rows in the DataList.
Filtered rows and the drilled-down rows on the gridView will not be counted.
Use getTotalRow to get the total number of the rows.
Return
typedescription
NumberTotal row count
getUnmatchedArray( col , dataValue , exactMatch , stRowIndex , lastRowIndex )
Converts the data of the row of which rowIndex is between stRowIndex and lastRowIndex and of which data is different from dataValue into JSON.
Parameter
nametyperequireddescription
colNumberYColumn index or ID
dataValueStringYData to compare
exactMatchBooleanY[true, false] Whether they exactly match or not
stRowIndexNumberYIndex of the starting row
lastRowIndexNumberYIndex of the last row
Return
typedescription
JSONJSON array with a matching array within the range
<Array> columnInfo : An array of column IDs <Array> data : One-dimensional array of the cell data in the order of the columInfo ID
Sample
// Two columns of name and the birthday are defined in the following DataList. // Among the rows from Index 0 to Index 10, the data of which birthday column does not include "198" will be returned. var rsData = dataList1.getUnmatchedArray( 'birthday', '198', false, 0, 10 )); // (Return Example) { "columnInfo":["name","birthday"] ,"data":["Chris","19930516","John","19780207","Jason","19930817","Hanna","19920606"] }
getUnmatchedColumnData( matchCol , dataValue , targetCol , exactMatch , stRowIndex , lastRowIndex )
Returns the data of the targetCol of which rowIndex of the specified matchCol is not same as dataValue among the rows between stRowIndex and lastRowIndex as JSON.
Parameter
nametyperequireddescription
matchColNumber||StringYColumn index or ID to check the data
dataValueStringYString to compare with the data of the matchCol
targetColNumber||StringYColumn index or ID to get the data from
exactMatchBooleanY[true,false] Whether they exactly match or not
stRowIndexNumberYFirst row index to get the data
lastRowIndexNumberYLast row index to get the data
Return
typedescription
ArrayOne-dimensional array of the targetCol data
Sample
// Among the rows from Index 0 to Index 10, return the name of the row of which birthday column includes "198". var rsData = dataList1.getUnmatchedColumnData("birthday","198","name",false,0,10) // (Return Example)) ["Chris","John","Jason","Hanna"]
getUnmatchedData( col , dataValue , exactMatch , stRowIndex , lastRowIndex )
Returns the data of the rows of which rowIndex of the specified column is not same as dataValue among the rows between stRowIndex and lastRowIndex as an array.
Parameter
nametyperequireddescription
colNumber||StringYColumn index or ID to check the data
dataValueStringYData to compare with the row of the corresponding col
exactMatchBooleanYWhether they exactly match or not
stRowIndexNumberYFirst row index to get the data
lastRowIndexNumberYLast row index to get the data
Return
typedescription
ArrayTwo-dimensional array of the matching data within the range
Sample
// Two columns of name and the birthday are defined in the DataList. // Among the rows from Index 0 to Index 10, convert the data the row of which birthday column does not include "198" into an array. var rsData = dataList1.getUnmatchedData("birthday","198",false,0,10) // (Return Example) [["Chris","19930516"],["John","19780207"],["Jason","19930817"],["Hanna","19920606"]]
getUnmatchedIndex( col , dataValue , exactMatch , stRowIndex , lastRowIndex )
Returns the indices of the rows of which rowIndex of the specified column is not same as dataValue among the rows between stRowIndex and lastRowIndex as an array.
Parameter
nametyperequireddescription
colNumber||StringYIndex or ID of the column to check data
dataValueStringYData to compare with the row of the corresponding col
exactMatchBooleanY[true,false] Whether they exactly match or not
stRowIndexNumberYIndex of the starting row
lastRowIndexNumberYIndex of the last row
Return
typedescription
ArrayArray of the index data of the rows within the specified range
Sample
// Among the rows from Index 0 to Index 10, return the indices of the rows of which birthday column does not include "198" as an array. var returnArr = dataList1.getUnmatchedIndex("birthday","198",false,0,10) // (Return Example)[0,1,2,5]
getUnmatchedJSON( col , dataValue , exactMatch , stRowIndex , lastRowIndex )
Converts the data of the rows of which rowIndex of the specified column is not same as dataValue among the rows between stRowIndex and lastRowIndex into JSON and returns as an array.
Parameter
nametyperequireddescription
colNumber||StringYIndex or ID of the column to check the data
dataValueStringYData to compare with the data in the col column
exactMatchBooleanY[default:true, false] Whether they exactly match or not
stRowIndexNumberYIndex of the first row
lastRowIndexNumberYIndex of the last row
Return
typedescription
ArrayOne-dimensional array of the matching rows
Sample
// Among the rows from Index 0 to Index 10, return the indices of the rows of which birthday column does not include "198" as an array. var returnData = dataList1.getUnmatchedJSON("birthday","198",false,0,10)) // (Return Example) [ {"name":"Chris","birthday":"19930516","rowStatus":"R"} ,{"name":"John","birthday":"19780207","rowStatus":"R"} ,{"name":"Jason","birthday":"19930817","rowStatus":"R"} ,{"name":"Hanna","birthday":"19920606","rowStatus":"R"} ]
getUnmatchedXML( col , dataValue , exactMatch , stRowIndex , lastRowIndex )
Returns the data of the rows of which rowIndex of the specified column is not same as dataValue among the rows between stRowIndex and lastRowIndex as an XML.
Parameter
nametyperequireddescription
colNumber||StringYIndex or ID of the column to check data
dataValueStringYIndex or ID of the column to check the data
exactMatchBooleanY[true,false] Whether they exactly match or not
stRowIndexNumberYIndex of the first row
lastRowIndexNumberYIndex of the last row
Return
typedescription
XMLMatching XML data within the range
Sample
// Among the rows from Index 0 to Index 10, return the data of the rows of which birthday column does not include "198" as an XML. var returnData = dataList1.getUnmatchedXML("birthday","198",false,0,10); // (Return Example) <list id="dc_tmpUserData"> <map index="0"> <name>Chris</name> <birthday>19930516</birthday> <rowStatus statusValue="0">R</rowStatus> </map> <map index="1"> <name>John</name> <birthday>19780207</birthday> <rowStatus statusValue="0">R</rowStatus> </map> <map index="2"> <name>Jason</name> <birthday>19930817</birthday> <rowStatus statusValue="0">R</rowStatus> </map> <map index="5"> <name>Hanna</name> <birthday>19920606</birthday> <rowStatus statusValue="0">R</rowStatus> </map> </list>
getUpdatedArray( )
Returns the data of the rows in updated status (1, U) as JSON.
Returns the data of the rows in updated status (1, U) as JSON. columnInfo array contains column IDs and data array contains the data in the order of columnInfo.
Return
typedescription
JSONJSON data that contains the rows in updated status
<Array> columnInfo : An array of column IDs <Array> data : One-dimensional array of the cell data in the order of the columInfo ID
Sample
// "dept" and "name" are defined in the DataList. // Return the data in updated (U) status. Total two cases will be returned. var rsData = dataList1.getUpdatedArray()); // (Return Example) { "columnInfo":["dept","name"] ,"data":["HR","Changed","HR","Changed2"] }
getUpdatedData( )
Returns the data of the rows in the updated status (1, U) as an array.
Return
typedescription
ArrayTwo-dimensional array of the rows in updated status (1, U)
Sample
// "dept" and "name" are defined in the DataList. // Return the data in updated (U) status. Total two cases will be returned. var rsData = dataList1.getUpdatedData(); // (Return Example) [["HR","Changed"],["HR","Changed2"]]
getUpdatedIndex( )
Returns the indices of the rows in the updated status (1, U) as an array.
Return
typedescription
ArrayArray of the indices of the rows in updated status (1, U)
Sample
// Return the indices of the row in updated (U) status. var rsData = dataList1.getUpdatedIndex(); // (Return Example) [3,4]
getUpdatedJSON( )
Converts the data of the rows in updated status (1 or U) into JSON and returns as an array.
Return
typedescription
ArrayArray of the JSON data of the rows in updated status (1 or U)
Sample
var rsData = dataList1.getUpdatedJSON(); // (Return Example) [ {"dept":"HR","name":"Changed","rowStatus":"U"} ,{"dept":"HR","name":"Changed2","rowStatus":"U"} ]
getUpdatedXML( )
Returns the data of the rows in update status (1 or U) as an XML.
Return
typedescription
XMLXML of the rows in updated status (1 or U)
Sample
// Define "dept" and "name" columns in the DataList. var rsData = dataList1.getUpdatedXML() // (Return Example) <list id="dataList1"> <map index="3"> <dept>HR</dept> <name>Changed</name> <rowStatus statusValue="1">U</rowStatus> </map> <map index="4"> <dept>HR</dept> <name>Changed2</name> <rowStatus statusValue="1">U</rowStatus> </map> </list>
getVoidArray( )
Returns the rows in removed and deleted status (4 or V) as JSON.
Return
typedescription
JSONJSON of the rows in inserted and deleted status (4 or V)
<Array> columnInfo : An array of column IDs <Array> data : One-dimensional array of the cell data in the order of the columInfo ID
Sample
var returnJsonArr = dataList1.getVoidArray(); // (Return Example) { "columnInfo":["dept","name"] ,"data":["",""] }
getVoidData( )
Returns the rows in inserted and removed status (4 or V) as an array.
Return
typedescription
ArrayTwo-dimensional array that contains the array data of the rows in inserted and deleted status
Sample
var raData = dataList1.getVoidData(); // (Return Example) - Total 2 cases ) [ ["0","",""],["0","",""] ]
getVoidIndex( )
Returns the indices of the rows in inserted and deleted status (4 or V) as an array.
Return
typedescription
ArrayAn array of indices of the rows in inserted and deleted status (4 or V)
Sample
var returnArr = dataList1.getVoidIndex(); // (Return Example) - Total 2 cases ) [0,1]
getVoidJSON( )
Returns the JSON data of the rows in inserted and removed status (4 or V) as an array.
Return
typedescription
ArrayAn array ofhe JSON data of the rows in inserted and removed status (4 or V)
Sample
var returnJsonStr = dataList1.getVoidJSON(); // (Return Example) - Total 2 cases ) [ {"dept":"","name":"","rowStatus":"V"} ,{"dept":"","name":"","rowStatus":"V"} ]
getVoidXML( )
Returns the data of the rows in inserted and removed status (4, V) as an XML.
Return
typedescription
XMLXML data of the rows in inserted and removed status (4, V)
Sample
var returnXMLStr = dataList1.getVoidXML(); // (Return Example) - Total 2 cases ) <list id="dataList1"> <map index="0"> <dept></dept> <name></name> <rowStatus statusValue="4">V</rowStatus> </map> <map index="1"> <dept></dept> <name></name> <rowStatus statusValue="4">V</rowStatus> </map> </list>
initRowStatus( )
Changes status of all DataList into “R”. Functions same as modifyAllStatus("R") except that the onrowstatuschange event is not triggered.
Sample
dataList1.initRowStatus(); // Puts all DataList into “R” status. The onrowstatuschange event does not occur.
insertData( rowIndex , dataObj )
Inserts multiple rows into the rowIndex as one-dimensional array. Data insertion will trigger oninsertrow event.
Parameter
nametyperequireddescription
rowIndexNumberYRow index
dataObjArrayYOne-dimensional array that contains the data
Sample
// "name" and "birthday" columns are defined in the DataList. // Insert two rows to Index 0. dataList1.insertData( 0, ["Chris", "19930516" ,"John" ,"19780207"] );
insertJSON( rowIndex , dataObj )
Inserts multiple rows into the rowIndex as a JSON object. Data insertion will trigger oninsertrow event.
Parameter
nametyperequireddescription
rowIndexNumberYRow index
dataObjArrayYOne-dimensional array containing the JSON object of the row
Sample
// "name" and "birthday" columns are defined in the DataList. // Define the data to insert into the DataList. var tmpData = [{"name":"Chris","birthday":"19930516"},{"name":"John","birthday":"19780207"}]; // Insert two rows to Index 0. dataList1.insertJSON( 0, tmpData );
insertRow( rowIndex )
Inserts a single row to the rowIndex. The insertion will trigger the oninsertrow event in the DataList.
Parameter
nametyperequireddescription
rowIndexNumberYIndex of the row to insert data
Sample
// Insert a new row to the first row. dataList1.insertRow(0);
insertXML( rowIndex , dataObj )
Inserts multiple rows into the rowIndex as XML data triggering the oninsertrow event in the DataList. Data insertion will trigger oninsertrow event.
Parameter
nametyperequireddescription
rowIndexNumberYRow index
dataObjXMLYXML that contains the data
Sample
// "name" and "birthday" columns are defined in the DataList. //XML String var xmlStr = "<list><map><name>Chris</name><birthday>19930516</birthday></map></list>"; // Create XML data. var dataObj = WebSquare.xml.parse(xmlStr); // Insert a row to Index 0. insertXML(0, dataObj)
keepRowPosition( )
Keeps the previous rowPosition when appending the JSON data.
modifyAllStatus( status )
Modifies the status of all rows.
Parameter
nametyperequireddescription
statusStringYNew status (Default:"R", Updated:"U", Inserted:"C", Deeted:"D", Inserted and Deleted:"V"). Data manipulation through the changes of the status code is not allowed. Do not use "E" value.
Sample
dataList1.modifyAllStatus('D'); // Change all row status into D.
modifyMatchedStatus( col , dataValue , status )
Modifies the status of the rows in which the specified column is same as dataValue.
Parameter
nametyperequireddescription
colNumber||StringYIndex or ID of the column to check the data
dataValueStringYValue to compare
statusStringYNew status. Data manipulation through change of the status code is not allowed. Do not use "E" value.
Sample
// Put all rows of which dept column has 'IT' into updated (U) status. dataList1.modifyMatchedStatus('dept', 'IT', 'U');
modifyRangeStatus( from , to , status )
Modifies the status of the rows within the specified range.
Parameter
nametyperequireddescription
fromNumberYIndex of the first row within the range to change
toNumberYIndex of the last row within the range to change
statusStringYNew status (Default:"R", Updated:"U", Inserted:"C", Deeted:"D", Inserted and Deleted:"V"). Data manipulation through the changes of the status code is not allowed. Do not use "E" value.
Sample
dataList1.modifyRangeStatus(1 , 3, 'D'); // Put the second and the third rows into deleted status.
modifyRowStatus( rowIndex , status )
Modifies the status of the rows of the corresponding rowIndex.
Parameter
nametyperequireddescription
rowIndexNumberYIndex of the row to change the status
statusStringYNew status. Data manipulation through change of the status code is not allowed. Do not use "E" value.
Sample
dataList1.modifyRowStatus(0, 'D'); // Put the first row into deleted status.
multisort( options )
Sorts multiple columns according to the specified option.
Sorts multiple columns according to the specified option. Sorting is made based on the dataType. For numeric data, set dataType as number.
Parameter
nametyperequireddescription
optionsJSONYJSON that has sorting options
<String:Y> options.sortIndex : ID or index of the column to sort. Use the space key to separate multiple rows. <String:Y> options.sortOrder : Sorting type (1: Ascending -1: Descending). Use the space key to specify sorting types for multiple rows.
Sample
// Sort the name column in descending order and the depth column in ascending order. var options = {}; options.sortIndex = "name dept"; options.sortOrder = "-1 1"; dataList1.multisort( options );
redo( )
Goes back to the previous change.
Sample
// Goes back to the previous change. dataList1.redo();
reform( )
Converts the originalData of the DataList into the current data, and initializes the status of all rows (into R status).
Sample
Set all rows to the initial status (0, R).
removeAll( )
Removes all data of the DataList and returns the removed data as a one-dimensional array.
Return
typedescription
ArrayOne-dimensional row of the data of the deleted rows
Sample
// "name" and "dept" are defined in the DataList. var returnArr = dataList1.removeAll(); // (Return Example) - Total 5 cases deleted.)["HR", "Sammy", "HR", "Samuel", "IT", "Gina", "HR", "Roy", "HR", "Kay"]
removeColumnFilter( col )
Removes filtering from the specified column.
Note that when using the setColumnFilter in multiple columns, beware operationType(AND, OR condition) of an unreleased filter.
Parameter
nametyperequireddescription
colNumber||StringYIndex or ID of the column to remove filtering
Sample
dataList1.removeColumnFilter( 'dept' ); // Remove filtering from "dept" column.
removeColumnFilterAll( )
Removes filtering from all columns.
Sample
dataList1.removeColumnFilterAll(); // Remove filtering from all columns.
removeRange( startIdx , endIdx )
Removes the rows between startIdx and endIdx, and returns the data as a one-dimensional array.
Parameter
nametyperequireddescription
startIdxNumberYIndex of the first row within the range to delete the data
endIdxNumberYThe ending row within the range to delete the data
Return
typedescription
ArrayTwo-dimensional array within the range to delete the data
Sample
// Define "dept" and "name" columns in the DataList. // Delete the first and the second rows. var returnArr = dataList1.removeRange(0, 1); // (Return Example) [["IT","Gina"],["HR","Samuel"]]
removeRow( rowIndex )
Removes the row of the corresponding rowIdex, and returns the data as a one-dimensional array.
Parameter
nametyperequireddescription
rowIndexNumberYIndex of the row to delete
Return
typedescription
ArrayData array of the removed row
Sample
// Remove the first row. var returnArr = dataList1.removeRow(0); // (Return Example) ["IT","Gina"]
removeRows( rowIndexArr )
Removes multiple rows based on an index array, and returns the data as a two-dimensional array.
Parameter
nametyperequireddescription
rowIndexArrArrayYArray of the indices of the rows to delete
Return
typedescription
ArrayTwo-dimensional array data of the removed rows
Sample
// Define "dept" and "name" columns in the DataList. // Delete fourth and fifth rows. var rsData = dataList1.removeRows([3,4]) // (Return Example) [["HR","Kay"],["HR","Roy"]]
restore( )
Returns the data to the previous stage.
Sample
// Returns data to the previous stage. dataList1.restore();
rowMoveDown( rowIndex )
Moves down the row of the corresponding rowIndex.
Parameter
nametyperequireddescription
rowIndexNumberYRow index
Sample
// Move down the second row. (The position of the second row and the third row will change.) dataList1.rowMoveDown(1);
rowMoveUp( rowIndex )
Moves up the row of the corresponding rowIndex.
Parameter
nametyperequireddescription
rowIndexNumberYRow index
Sample
// Move up the second row. (The positions of the first row and the second row will change.) dataList1.rowMoveUp(1);
setArray( jsonData , append )
Sets the data of the one-dimensional array in the DataList according to the column order of columnInfo. (The row status is changed to the default status R.)
Parameter
nametyperequireddescription
jsonDataJSONYJSON that contains column information and one-dimensional array data
<Array:Y> columnInfo : Order of the columns to set the data <Array:Y> data : Column data according to columnInfo. The entire data will be in the one-dimensional array.
appendStringN[default:false, true] Appending status
Sample
// Define "name", "dept", and "phone" in the DataList in the written order. // Delete data in three rows in "name" and "dept" columns, and set new data. var tmpColInfoArr = ["dept","name"]; var tmpDataArr = ["IT","Sammy","HR","Kay","HR","Gina"]; // The data order must match with that of tmpColInfoArr. dataList1.setArray( {"columnInfo":tmpColInfoArr, "data":tmpDataArr} );
setBroadcast( flag , refresh )
Sets whether to broadcast the change of the dataList to the bound component.
Parameter
nametyperequireddescription
flagBooleanY[true, false] Setting status
refreshBooleanY[true, false] Whether to refresh or not
Sample
dataList1.setBroadcast(false); // Sets the broadcast flag as false. Then, changes in the DataList will not be reflected on the bound component. dataList1.setBroadcast(true); // When set true, the changes in the DataList will be updated on the bound component. However, the refresh option must be true to immediately apply the changes. dataList1.setBroadcast(true, true); // Immediately updates the components bound with the DataList, and sets the broadcast flag as true.
setCellAllData( realRowIndex , colIndex , data )
Executes setCellData based on the rowIndex of the unfiltered data. Updates the filter.
Parameter
nametyperequireddescription
realRowIndexNumberYrowIndex of the unfiltered data
colIndexNumber||StringYColumn index or ID
dataStringYData to set in the cell
Sample
// When rows 1 and 2 are filtered and hidden. dataList1.setCellData(3,"name", "100"); // Set “100” in the fifth row of the name column in the dataList. dataList1.setCellAllData(3, "name", "100"); // Set “100” in the third row of the name column in the dataList. Updates the filter and renders the UI again.
setCellData( rowIndex , colIndex , data )
Sets the data in the cell of the corresponding rowIndex and colIndex.
Parameter
nametyperequireddescription
rowIndexNumberYRow index
colIndexNumber||StringYColumn index or ID
dataStringYData to set in the cell
Sample
// Set the value in "name" column of the first row. dataList1.setCellData(0, "name", "Gina");
setColumnDefaultValue( colIndex , defaultValue )
Sets the defaultValue as the default value of the row of the corresponding colIndex.
When no valud is set by insertRow or durin initialization, the dafaultValue will be used.
Parameter
nametyperequireddescription
colIndexNumber||StringYColumn index or ID
defaultValueStringYDefault value to set in the column
Sample
// Set the default value of the "name" column as "mandatory". dataList1.setColumnDefaultValue('name', 'mandatory'); // Subsequent calling of insertRow will set "mandatory" in name column. dataList1.insertRow(0);
setColumnFilter( filterOptions )
Applied filtering to the column of the corresponding colIndex.
Parameter
nametyperequireddescription
filterOptionsJSONYFiltering option.
<String:Y> filterOptions.type :[row, func, regExp] Filter type. ("row": Uses indexOf. "regExp": Regular expression. "func": User-defined function.) <String:Y> filterOptions.colIndex : Column index or ID to apply the filter. <String:Y> filterOptions.key : Filtering option. ("row": String value to compare. "regExp": Regular expression. "func": User-defined function.) <String:Y> filterOptions.condition : [and, or] Condition to merge with the previous filtering. The initial value is "and". <Boolean:N> filterOptions.exactMatch :[true, false] row filter에서 equal 조건 검색 수행. ("true": equal 조건 검색. "false" (기본 값): like 조건 검색.) <Object:Y> filterOptions.param : key의 값이 "func"일 때 함수로 넘길 파라미터.
Sample
// Filtering example - When the DataList and the GridView are bound. // (1) type:"row" - Apply filtering using indexOf for the strings with type:"row" - key. // (Example) Display rows of which value contains “IT” in the dept column on the GridView. (like search) dataList1.setColumnFilter( {type:'row', colIndex:'dept', key:"IT", condition:'and'} ); // (Example) Display rows of which value is “IT” in the dept column on the GridView. (equal search) dataList1.setColumnFilter( {type:'row', colIndex:'dept', key:"IT", condition:'and', exactMatch:true} ); // (Example) Display rows of which value is “IT” or “PR” in the dept column. (Change the condition in to “or”.) dataList1.setColumnFilter( {type:'row', colIndex:'dept', key:"PR", condition:'or'} ); // The above method is not efficient. Using a user-defined filter or regular expression is recommended as shown below. // (2) type:"func" - User-defined filtering. // (Example) User-defined Filter - cellData is "IT" and "PR". // cellData is the cell data of the colIndex retured by WebSquare 5 engine. // tmpParam is the parameter received upon calling of setColumnFilter. // rowIdx is the index of the row returned by the WebSquare5 Engine. var fn_tmpDeptFilter = function(cellData, tmpParam, rowIdx){ if(cellData.indexOf("IT") > -1){ return true; }else if(cellData.indexOf("HR") > -1){ return true; } return false; // In case true is returned, apply. Or in case false is returned, skip. } // (Example) Display the rows in the dept column of which value is "IT" or "HR". // Separate parameters will not be added to the function. dataList1.setColumnFilter( {type:'func', colIndex:'dept', key:fn_tmpDeptFilter, condition:'and'} ); // (3) type:"regExp" - Use a regular expression. // (Example) Display rows of which value is “IT” or “PR” in the dept column. dataList1.setColumnFilter( {type:'regExp', colIndex:'dept', key:/IT|PR/gi, condition:'and'} );
setData( arr , append , columnArr , rowStatus )
Sets or appends the data in the one-dimensional array. (The row status will be changed into "R". Always append the data when using columnArr to set the order of the data.)
Parameter
nametyperequireddescription
arrArray||StringYOne-dimensional array or array-type string (that will be converted into array later.)
appendBooleanN[default:false, true] Appending status
columnArrArray||StringNAn array that contains the IDs of the columns to set the data or an array-type string (that will be converted into array later.)
rowStatusArrayNOne-dimensional array containing rowStatus of the data to set
Sample
// Define "name" and "dept" columns in the DataList. // Set data for two rows. dataList1.setData(["Jina","HR","Harrison","Police"]); // Sets data in the name column with two (row) data, and other columns as empty (" "). dataList1.setData(["Jina","Harrison"],false,["name"]); // Set only the data of the name column among two-row data, and change two rowStatus. dataList1.setData(["Gina","Patrick"],false,["name"],["U", "D"]); // Array-type string received from the server. (Get the data from the DB in Java, and append data using "%||%".) var tmpStr = "Jina%||%HR%||%Harrison%||%Police"; var tmpArr = tmpStr.split("%||%"); dataList1.setData(tmpArr); // Array-type string received from the server. (Get the data from the DB in Java, and append data using "%||%".) var tmpStr = "[\"Jina\",\"HR\",\"Harrison\",\"Police\"]"; dataList1.setData(tmpStr);
setJSON( jsonData , append )
Sets or appends the JSON data. (The row status is changed into R.)
Parameter
nametyperequireddescription
jsonDataArrayYAn array of JSON data
appendStringNAppend or not.
"false" (Default) : Newly sets the data in the DataList. "true": Appends the data to the existing data of the DataList.
Sample
// Sets two list data in JSON. var tmpArr = [{"name":"Sammy","dept":"HR"},{"name":"Gina","dept":"IT"}]; dataList1.setJSON( tmpArr );
setMatchIgnoreCase( flag )
Sets the capital-sensitive status when calling APIs such as getMatchedJSON, getMatchedIndex, etc.
Parameter
nametyperequireddescription
flagBooleanYCapital-sensitive: false , Not Capital-sensitive: true
Sample
dataList1.setMatchIgnoreCase(true); dataList1.getMatchedIndex("ab"); // Execution Result: Returns the index of the data that contains Ab, aB, or AB among dataList1 data.
setRowArray( rowIndex , dataObj , overwrite )
Insert array data in the corresponding row.
If overwrite is false, a new row will be created.
Parameter
nametyperequireddescription
rowIndexNumberYIndex of the row to set rowData
dataObjJSONYJSON containing the data to set in the row
<Array:Y> dataObj.columnInfo : One-dimensional array of the IDs of the columns to set the data <Array:Y> One-dimensional array that contains data in the order of columnInfo. (Only a single row will be processed.)
overwriteBooleanN[default:false, true] Whether to allow overwriting or not. In case of true, the corresponding row will be overwritten. Otherwise, a new row will be inserted to rowIndex.
Sample
// When "name", "dept", and "addr" columns are defined in DataList. // Create row data and information. var dataObj = {}; dataObj.columnInfo = ["name","dept"]; dataObj.data = ["Stanley", "HR"]; // Set only in "name" and "dept" columns of the first row. dataList1.setRowArray(0, dataObj); // Inserted into the first row because overwriting is not allowed.
setRowData( rowIndex , rowData , overwrite )
Sets single-row data to the row of the corresponding rowIndex.
If overwrite is false, a new row will be created.
When bound with the GridView, the scrolling position will be kept after the function is executed.
Parameter
nametyperequireddescription
rowIndexNumberYIndex of the row to set rowData
rowDataArrayYOne-dimensional array containing the data in the column order defined in the DataList
overwriteBooleanN[default:false, true] Whether to allow overwriting or not. In case of true, the corresponding row will be overwritten. Otherwise, a new row will be inserted to rowIndex.
Sample
// Define "name" and "dept" columns in the DataList. // One-dimensional array containing the data in the column order defined in the DataList. dataList1.setRowData(0,["Jerry","Police"],true);
setRowJSON( rowIndex , rowData , overwrite )
Sets single-row JSON data to the row of the corresponding rowIndex.
If overwrite is false, a new row will be created.
Parameter
nametyperequireddescription
rowIndexNumberYIndex of the row to set rowData
rowDataJSONYJSON object data to set in the row
overwriteBooleanN[default:false, true] Whether to allow overwriting or not. In case of true, the corresponding row will be overwritten. Otherwise, a new row will be inserted to rowIndex.
Sample
// Define "name" and "dept" columns in the DataList. // Set JSON data that has data only in "name" columne of the first row. dataList1.setRowJSON(0, {"name":"Jean"} );
setRowNumData( flag )
Sets whether to add the number value of the row when the return data of the get API is JSON or XML.
The value is same as the one returned when rowNumVisible is "true" in GridView.
Data getting APIs include getAllJSON, getRowJSON, getAllXML, and getRowXML.
Parameter
nametyperequireddescription
flagBooleanY[true, false] Setting status
Sample
// Define "name" and "dept" columns in the DataList. // Execute getRowJSON without separate settings. dataList1.getRowJSON(0); // (Return Example) {"dept":"HR","name":"Sammy","rowStatus":"R"} // Add rowNum field, and execute getRowJSON. dataList1.setRowNumData(true); dataList1.getRowJSON(0); // (Return Example) {"dept":"HR","name":"Sammy","rowStatus":"R","rowNum":1}
setRowPosition( position , noEvent )
Sets the position of the row to select from the component bound with the DataList.
However, use only when bound with a single component like Input bound through the ref property.
When bound with the GridView, use setFocusedCell API of the GridView.
When selecting a cell with the setFocusedCell API of the GridView, the focus also moves.
To select only the DataList without moving the focus on the GridView, use this API.
Parameter
nametyperequireddescription
positionNumberNIndex of the row to select (or focus)
noEventBooleanNWhether to set onrowpositionchange event or not
Sample
// Define a DataList. <w2:dataList id="dataList1"> <w2:columnInfo> <w2:column id="name" name="이름" dataType="text"></w2:column> <w2:column id="dept" name="부서" dataType="text"></w2:column> </w2:columnInfo> <w2:data xmlns=""> <w2:row> <name><![CDATA[손예진]]></name> <dept><![CDATA[인사]]></dept> </w2:row> <w2:row> <name><![CDATA[송강호]]></name> <dept><![CDATA[홍보]]></dept> </w2:row> <w2:row> <name><![CDATA[전지현]]></name> <dept><![CDATA[IT]]></dept> </w2:row> <w2:row> <name><![CDATA[류승룡]]></name> <dept><![CDATA[인사]]></dept> </w2:row> </w2:data> </w2:dataList> // Define ref property of the Input component as "data:dataList1.name" in the body section. <xf:input id="input1" style="position: relative;width: 144px;height: 21px;" ref="data:dataList1.name"></xf:input> // No input during initial loading. // Position applied to the first row in the DataList. dataList1.setRowPosition(0); // (Display Result) Sammy // Position applied to the third row of the DataList. dataList1.setRowPosition(2); // (Display Result) Gina
setRowXML( rowIndex , XML , overwrite )
Inserts single-row XML data to the row of the corresponding rowIndex.
If overwrite is false, a new row will be created.
Parameter
nametyperequireddescription
rowIndexNumberYIndex of the row to set rowData
XMLXML elementYXML data to set rowData in the row
overwriteBooleanN[default:false, true] Whether to allow overwriting or not. In case of true, the corresponding row will be overwritten. Otherwise, a new row will be inserted to rowIndex.
Sample
// Combination of XML data string var tmpXMLStr = "<map><name>Gina</name><dept>IT</dept></map>"; // Create XML data. var xmlDoc = WebSquare.xml.parse(tmpXMLStr); // Set a single XML data in the first column of the DataList. dataList1.setRowXML(0, xmlDoc);
setXML( xmlData , append )
Sets or appends the XML data. (The row status is changed into R.)
Parameter
nametyperequireddescription
xmlDataXMLYXML data
appendStringNAppend or not.
"false" (Default) : Newly sets the data in the DataList. "true": Appends the data to the existing data of the DataList.
Sample
// Create XML strings. var tmpXMLStr = ""; tmpXMLStr += "<list>"; tmpXMLStr += "<map><name>Gina</name><dept>IT</dept></map>"; tmpXMLStr += "<map><name>Roy</name><dept>HR</dept></map>"; tmpXMLStr += "</list>"; // Create XML data. var tmpXML = WebSquare.xml.parse(tmpXMLStr); // Set two dat dat in XML format. dataList1.setXML (tmpXML);
sort( bodyColumnID , sortType )
Sorts a single column. (For multiple columns, use multisort API.)
Sorts all data assuming the data type is text. (For the number type, use multisort.)
Parameter
nametyperequireddescription
bodyColumnIDStringYColumn ID
sortTypeNumberY[0,1,2] Sorting option. 0: Ascending, 1: Descending, 2: Unsort
Sample
// Sort the values of "name" column in ascending order. dataList1.sort('name', 0);
trigger( type , array )
Triggers events registered of the DataList.
Parameter
nametyperequireddescription
typeStringYName of the event to trigger
arrayObjectNArray of parameters to send to the event handler
Sample
// Trigger oncelldatachange event in dataList1. dataList1.trigger("oncelldatachange"); // Trigger oncelldatachange event in dataList1, and send paramJSON to the function. var paramJSON = {rowIndex:5,colID:"col1",oldValue:10,newValue:20}; dataList1.trigger("oncelldatachange", [ paramJSON ]);
unbind( type , function )
Dynamically removes the events of the DataList.
Parameter
nametyperequireddescription
typeStringNName of the event to remove. If not specified, all events of the components will be removed.
functionFunctionNHandler function of the event to remove. If not specified, all handler functions of the event will be removed.
Sample
// Remove the func1 event handler among the handlers registered for oncelldatachange event of dataList1. dataList1.unbind("oncelldatachange", func1); // Remove all events registered in dataList1. dataList1.unbind();
undeleteRow( rowIndex )
Undeletes (or cancels D or V status of) the row of the corresponding rowIndex, and returns to the previous status.
Rows removed by removeRow (in status E) will not be undeleted.
Parameter
nametyperequireddescription
rowIndexNumberYIndex of the row to undelete
Sample
// Undelete the first row row. (Changed into the previous status.) dataList1.undeleteRow(0);
undoAll( )
Initializes the entire data (into originalData) and resets the row status (into R).
Initialized data is same as those set by setJSON or setXML.
Sample
// Initialize all updated or deleted data into originalData. dataList1.undoAll();
undoRow( rowIndex )
Changes the data and the status of the row of the corresponding rowIndex.
Parameter
nametyperequireddescription
rowIndexNumberYIndex of the row to change the data
Sample
// Restores the data of the first row. dataList1.undoRow(0);