{/* Do not edit this file. It is automatically generated by API Documenter. */}


## LocalTreeDataProvider

LocalTreeDataProvider class. Inherits [DataProviderBase](/refs/Class/DataProviderBase).

**Signature:**

```typescript
export declare class LocalTreeDataProvider extends DataProviderBase
```
**Extends:** [DataProviderBase](/refs/Class/DataProviderBase)

## Remarks

\[Superclass\]

[DataProviderBase](/refs/Class/DataProviderBase)

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `LocalTreeDataProvider` class.

## Properties

| Property | Type | Description |
| --- | --- | --- |
| [onDataChanged](/refs/Class/LocalTreeDataProvider#ondatachanged) | (provider: [LocalTreeDataProvider](/refs/Class/LocalTreeDataProvider){/* */}) =&gt; void | A callback notifying that data has changed |
| [onRowAdded](/refs/Class/LocalTreeDataProvider#onrowadded) | (provider: [LocalTreeDataProvider](/refs/Class/LocalTreeDataProvider){/* */}, row: number) =&gt; void | A callback notifying that a row has been added |
| [onRowAdding](/refs/Class/LocalTreeDataProvider#onrowadding) | (provider: [LocalTreeDataProvider](/refs/Class/LocalTreeDataProvider){/* */}, row: number, index: number, child: any) =&gt; boolean | A callback that determines whether a row is added |
| [onRowCountChanged](/refs/Class/LocalTreeDataProvider#onrowcountchanged) | (provider: [LocalTreeDataProvider](/refs/Class/LocalTreeDataProvider){/* */}, newCount: number) =&gt; void | Callback notifying that the number of rows has changed |
| [onRowDeleted](/refs/Class/LocalTreeDataProvider#onrowdeleted) | (provider: [LocalTreeDataProvider](/refs/Class/LocalTreeDataProvider){/* */}, row: number) =&gt; void | Callback notifying that a row has been deleted |
| [onRowDeleting](/refs/Class/LocalTreeDataProvider#onrowdeleting) | (provider: [LocalTreeDataProvider](/refs/Class/LocalTreeDataProvider){/* */}, row: number) =&gt; boolean | A callback that determines whether to delete a row |
| [onRowParentChanged](/refs/Class/LocalTreeDataProvider#onrowparentchanged) | (provider: [LocalTreeDataProvider](/refs/Class/LocalTreeDataProvider){/* */}, row: number, parent: number, index: number) =&gt; void | A callback notifying that a row's parent has changed |
| [onRowParentChanging](/refs/Class/LocalTreeDataProvider#onrowparentchanging) | (provider: [LocalTreeDataProvider](/refs/Class/LocalTreeDataProvider){/* */}, row: number, parent: number, index: number) =&gt; boolean | A callback that determines whether to change the parent of a row |
| [onRowsAdded](/refs/Class/LocalTreeDataProvider#onrowsadded) | (provider: [LocalTreeDataProvider](/refs/Class/LocalTreeDataProvider){/* */}, parent: number, rows: number\[\]) =&gt; void | A callback indicating that rows have been added |
| [onRowsDeleted](/refs/Class/LocalTreeDataProvider#onrowsdeleted) | (provider: [LocalTreeDataProvider](/refs/Class/LocalTreeDataProvider){/* */}, rows: number\[\]) =&gt; void | Callback notifying that rows have been deleted |
| [onRowSiblingMoved](/refs/Class/LocalTreeDataProvider#onrowsiblingmoved) | (provider: [LocalTreeDataProvider](/refs/Class/LocalTreeDataProvider){/* */}, row: number, offset: number) =&gt; void | A callback indicating that rows have been moved between siblings |
| [onRowSiblingMoving](/refs/Class/LocalTreeDataProvider#onrowsiblingmoving) | (provider: [LocalTreeDataProvider](/refs/Class/LocalTreeDataProvider){/* */}, row: number, offset: number) =&gt; boolean | Callback to determine movement of rows between siblings |
| [onRowsSiblingMoved](/refs/Class/LocalTreeDataProvider#onrowssiblingmoved) | (provider: [LocalTreeDataProvider](/refs/Class/LocalTreeDataProvider){/* */}, rows: number\[\], offset: number) =&gt; void | A callback indicating that a sibling has been moved using dragAndDrop |
| [onRowsSiblingMoving](/refs/Class/LocalTreeDataProvider#onrowssiblingmoving) | (provider: [LocalTreeDataProvider](/refs/Class/LocalTreeDataProvider){/* */}, rows: number\[\], offset: number) =&gt; boolean | Callback to determine movement between siblings using DragAndDrop |
| [onRowStateChanged](/refs/Class/LocalTreeDataProvider#onrowstatechanged) | (provider: [LocalTreeDataProvider](/refs/Class/LocalTreeDataProvider){/* */}, row: number) =&gt; void | A callback notifying that the row state has changed |
| [onRowStatesChanged](/refs/Class/LocalTreeDataProvider#onrowstateschanged) | (provider: [LocalTreeDataProvider](/refs/Class/LocalTreeDataProvider){/* */}, rows: number\[\]) =&gt; void | A callback notifying that the state of multiple rows has changed |
| [onRowsUpdated](/refs/Class/LocalTreeDataProvider#onrowsupdated) | (provider: [LocalTreeDataProvider](/refs/Class/LocalTreeDataProvider){/* */}, rows: number\[\]) =&gt; void | A callback to indicate that multiple rows of data have changed |
| [onRowsUpdating](/refs/Class/LocalTreeDataProvider#onrowsupdating) | (provider: [LocalTreeDataProvider](/refs/Class/LocalTreeDataProvider){/* */}, rows: number\[\]) =&gt; boolean | <p>Callback to determine changes to multiple data rows</p><p>\[Parameter list\]</p><p>`provider` - DataProvider control</p><p>`rows` - Tree id of data rows to be changed</p> |
| [onRowUpdated](/refs/Class/LocalTreeDataProvider#onrowupdated) | (provider: [LocalTreeDataProvider](/refs/Class/LocalTreeDataProvider){/* */}, row: number) =&gt; void | Callback notifying that a row has been modified |
| [onRowUpdating](/refs/Class/LocalTreeDataProvider#onrowupdating) | (provider: [LocalTreeDataProvider](/refs/Class/LocalTreeDataProvider){/* */}, row: number, oldValues: [RowValues](/refs/realgrid#rowvalues){/* */}, newValues: [RowValues] (/refs/realgrid#rowvalues){/* */}) =&gt; boolean | Callback to determine row modification |
| [onValueChanged](/refs/Class/LocalTreeDataProvider#onvaluechanged) | (provider: [LocalTreeDataProvider](/refs/Class/LocalTreeDataProvider){/* */}, row: number, field: number) =&gt; void | A callback to indicate that the value of the data has changed |

## Methods

| Method | Type | Description |
| --- | --- | --- |
| [addChildRow(row, values, iconIndex, hasChildren)](/refs/Class/LocalTreeDataProvider#addchildrow) | addChildRow(row: number, values: [DataValues](/refs/realgrid#datavalues){/* */}, iconIndex?: number, hasChildren?: boolean): number; | Adds a child row of the specified tree row. |
| [changeRowParent(row, parent, index)](/refs/Class/LocalTreeDataProvider#changerowparent) | changeRowParent(row: number, parent: number, index: number): boolean; | Moves the position of a specific data row to the lower part of the specified row. |
| [clearRows()](/refs/Class/LocalTreeDataProvider#clearrows) | clearRows(): void; | Delete all rows in DataProvider. |
| [fillCsvData(data, options)](/refs/Class/LocalTreeDataProvider#fillcsvdata) | fillCsvData(data: any, options: [DataFillOptions](/refs/Interface/DataFillOptions){/* */}): void; | Loads csv data according to the specified settings and saves it to the TreeDataProvider local storage. |
| [fillJsonData(data, options)](/refs/Class/LocalTreeDataProvider#filljsondata) | fillJsonData(data: any, options: [DataFillOptions](/refs/Interface/DataFillOptions){/* */}): void; | Loads Json data according to the specified settings and saves it to the TreeDataProvider local storage. |
| [fillXmlData(data, options)](/refs/Class/LocalTreeDataProvider#fillxmldata) | fillXmlData(data: any, options: [DataFillOptions](/refs/Interface/DataFillOptions){/* */}): void; | Loads xml data according to the specified settings and saves it to the TreeDataProvider local storage. |
| [getAncestors(row)](/refs/Class/LocalTreeDataProvider#getancestors) | getAncestors(row: number): number\[\]; | Returns the IDs of ancestor rows of the specified row. |
| [getChildCount(row)](/refs/Class/LocalTreeDataProvider#getchildcount) | getChildCount(row: number): number; | Returns the number of child rows of the specified row. |
| [getChildren(row)](/refs/Class/LocalTreeDataProvider#getchildren) | getChildren(row: number): number\[\]; | Returns the unique numbers of all child rows of a specified row. |
| [getDescendantCount(row)](/refs/Class/LocalTreeDataProvider#getdescendantcount) | getDescendantCount(row: number): number; | Returns the number of descendant rows of the specified row. |
| [getDescendants(row, maxLevel)](/refs/Class/LocalTreeDataProvider#getdescendants) | getDescendants(row: number, maxLevel?: number): number\[\]; | Returns the IDs of descendant rows of the specified row. |
| [getHiddenRows()](/refs/Class/LocalTreeDataProvider#gethiddenrows) | getHiddenRows(): number\[\]; | Returns the numbers of hidden rows. |
| [getIconIndex(row)](/refs/Class/LocalTreeDataProvider#geticonindex) | getIconIndex(row: number): number; | Returns the index of the icon displayed in the tree row. |
| [getJsonRow(row, rowState, recursive, childRowsProp, iconProp, level)](/refs/Class/LocalTreeDataProvider#getjsonrow) | getJsonRow(row: number, rowState?: boolean, recursive?: boolean, childRowsProp?: string, iconProp?: string, level?: number): any; | Returns the specified data row as a JSON object. |
| [getJsonRows(row, recursive, childRowsProp, iconProp, rowState)](/refs/Class/LocalTreeDataProvider#getjsonrows) | getJsonRows(row: number, recursive?: boolean, childRowsProp?: string, iconProp?: string, rowState?: boolean): object\[\]; | Returns the specified data row and descendants as a JSON object. |
| [getLevel(row)](/refs/Class/LocalTreeDataProvider#getlevel) | getLevel(row: number): number; | Returns the level of the specified row. |
| [getOutputRow(options, row, iconProp)](/refs/Class/LocalTreeDataProvider#getoutputrow) | getOutputRow(options: [DataOutputOptions](/refs/Interface/DataOutputOptions){/* */}, row: number, iconProp?: string): object; | Imports the specified data row as a JSON object by applying the format. |
| [getOutputRows(options, row, recursive, childRowsProp, iconProp)](/refs/Class/LocalTreeDataProvider#getoutputrows) | getOutputRows(options: [DataOutputOptions](/refs/Interface/DataOutputOptions){/* */}, row: number, recursive?: boolean, childRowsProp?: string, iconProp?: string): object\[\]; | The specified data row and descendants are formatted and imported as a JSON object. |
| [getParent(row)](/refs/Class/LocalTreeDataProvider#getparent) | getParent(row: number): number; | Returns the row id of the parent of the specified row. |
| [getRowCount()](/refs/Class/LocalTreeDataProvider#getrowcount) | getRowCount(): number; | Returns the number of stored data rows. |
| [getValue(row, field)](/refs/Class/LocalTreeDataProvider#getvalue) | getValue(row: number, field: string \| number): any; | Returns the value of the specified data cell. |
| [hideRows(dataRows)](/refs/Class/LocalTreeDataProvider#hiderows) | hideRows(dataRows: number\[\] \| number): void; | Hides the specified row or rows from the screen. |
| [insertChildNode(row, index, data, childrenProp, iconField, noState)](/refs/Class/LocalTreeDataProvider#insertchildnode) | insertChildNode(row: number, index: number, data: [RowObject](/refs/realgrid#rowobject){/* */}, childrenProp?: string, iconField?: string, noState?: boolean): any; | Add a child node to the specified tree row at the desired location. |
| [insertChildRow(row, index, values, iconIndex, hasChildren)](/refs/Class/LocalTreeDataProvider#insertchildrow) | insertChildRow(row: number, index: number, values: [DataValues](/refs/realgrid#datavalues){/* */}, iconIndex?: number, hasChildren?: boolean): number; | Adds a child row to the desired location among the child rows of the specified tree row. |
| [isHiddenRow(dataRow)](/refs/Class/LocalTreeDataProvider#ishiddenrow) | isHiddenRow(dataRow: number): boolean; | Returns whether the specified row is a hidden row. |
| [moveRowSibling(row, offset)](/refs/Class/LocalTreeDataProvider#moverowsibling) | moveRowSibling(row: number, offset: number): boolean; | The position of a specific data row is moved among siblings of the same parent by a specified number of steps. |
| [removeRow(row, recursive)](/refs/Class/LocalTreeDataProvider#removerow) | removeRow(row: number, recursive?: boolean): boolean; | Deletes the specified data row. |
| [removeRows(rows, recursive)](/refs/Class/LocalTreeDataProvider#removerows) | removeRows(rows: number\[\], recursive: boolean): boolean; | Deletes specified data rows. |
| [resetHiddenRows()](/refs/Class/LocalTreeDataProvider#resethiddenrows) | resetHiddenRows(): void; | Redisplays all hidden rows. |
| [searchData(options)](/refs/Class/LocalTreeDataProvider#searchdata) | searchData(options: [SearchCellOptions](/refs/Interface/SearchCellOptions){/* */}): [SearchCellResult](/refs/Interface/SearchCellResult){/* */}; | Finds cells with a specific value depending on how the search is set up. |
| [searchDataRow(options)](/refs/Class/LocalTreeDataProvider#searchdatarow) | searchDataRow(options: [SearchOptions](/refs/Interface/SearchOptions){/* */}): number; | Depending on how the search is set up, it finds rows with a specific value. |
| [setCsvRows(rows, treeField, needSorting, childrenField, iconField)](/refs/Class/LocalTreeDataProvider#setcsvrows) | setCsvRows(rows: string, treeField: string, needSorting?: boolean, childrenField?: string, iconField?: string): void; | Set the tree data as new CSV data. |
| [setIconIndex(row, iconIndex)](/refs/Class/LocalTreeDataProvider#seticonindex) | setIconIndex(row: number, iconIndex: number): void; | Changes the icon of the specified row. |
| [setNestedRows(json, rowsProp, childRowsProp, childrenProp, iconProp)](/refs/Class/LocalTreeDataProvider#setnestedrows) | setNestedRows(json: any, rowsProp: string, childRowsProp: string, childrenProp?: string, iconProp?: string): void; | Set the tree's data to new JSON data. |
| [setObjectRows(json, rowsProp, childrenProp, iconProp)](/refs/Class/LocalTreeDataProvider#setobjectrows) | setObjectRows(json: any, rowsProp: string, childrenProp?: string, iconProp?: string): void; | Set the tree's data to new JSON data. |
| [setRows(rows, treeField, needSorting, childrenField, iconField)](/refs/Class/LocalTreeDataProvider#setrows) | setRows(rows: [DataValues](/refs/realgrid#datavalues){/* */}\[\], treeField: string, needSorting?: boolean, childrenField?: string, iconField?: string): void; | Set the tree data as new data. |
| [setValue(row, field, value)](/refs/Class/LocalTreeDataProvider#setvalue) | setValue(row: number, field: string \| number, value: any): void; | Changes the value of a specified data cell. |
| [setXmlRows(xml, rowElement, childrenField, iconField)](/refs/Class/LocalTreeDataProvider#setxmlrows) | setXmlRows(xml: any, rowElement: string, childrenField?: string, iconField?: string): void; | Set the tree data as new XML data. |
| [showHiddenRows(dataRows)](/refs/Class/LocalTreeDataProvider#showhiddenrows) | showHiddenRows(dataRows: number\[\] \| number): void; | Shows hidden rows or rows on the screen. |
| [updateRow(row, values, strict)](/refs/Class/LocalTreeDataProvider#updaterow) | updateRow(row: number, values: [DataValues](/refs/realgrid#datavalues){/* */}, strict?: boolean): boolean; | Modifies the field values ​​of the specified data row. |
| [updateRows(rows, values, strict)](/refs/Class/LocalTreeDataProvider#updaterows) | updateRows(rows: number\[\], values: [DataValues](/refs/realgrid#datavalues){/* */}\[\], strict: boolean): void; | Modifies field values of specified data rows. |

## Properties Desc

### onDataChanged

A callback to notify you that data has changed

`Type` - (provider: [LocalTreeDataProvider](/refs/Class/LocalTreeDataProvider){/* */}) =&gt; void

**Remarks:**

Call after changing the data using key input or [LocalTreeDataProvider.setValue()](/refs/Class/LocalTreeDataProvider#setvalue).

\[Parameter list\]

`provider` - TreeDataProvider control

**Example:**


```js
dataProvider.onDataChanged = function (provider) {
 console.log('dataChanged!');
};
```

<hr/>

### onRowAdded

A callback notifying that a row has been added

`Type` - (provider: [LocalTreeDataProvider](/refs/Class/LocalTreeDataProvider){/* */}, row: number) =&gt; void

**Remarks:**

Called after data is added to TreeDataProvider.

\[Parameter list\]

`provider` - TreeDataProvider control

`row` - the tree id of the data row

**Example:**


```js
dataProvider.onRowAdded = function (provider, row) {
 console.log("DataProvider row added at "+ row);
};
```

<hr/>

### onRowAdding

A callback that determines whether a row is added

`Type` - (provider: [LocalTreeDataProvider](/refs/Class/LocalTreeDataProvider){/* */}, row: number, index: number, child: any) =&gt; boolean

**Remarks:**

Called just before data is added to TreeDataProvider.

\[Parameter list\]

`provider` - TreeDataProvider control

`row` - the tree id of the data row

`index` - Position (order) of the inserted row among the children of the parent row.

`child` - child data of the added row

**Example:**


```js
dataProvider.onRowAdding = function (provider, row, index, child) {
 if (row > 100) {
 return false;
 }
 return true;
};
```

<hr/>

### onRowCountChanged

Callback notifying that the number of rows has changed

`Type` - (provider: [LocalTreeDataProvider](/refs/Class/LocalTreeDataProvider){/* */}, newCount: number) =&gt; void

**Remarks:**

Called when the number of rows changes due to addition or deletion of rows, etc.

\[Parameter list\]

`provider` - TreeDataProvider control

`newCount` - Number of changed rows

**Example:**


```js
dataProvider.onRowCountChanged = function (provider, count) {
 console.log("DataProvider rowCount changed as: " + newCount);
};
```

<hr/>

### onRowDeleted

Callback notifying that a row has been deleted

`Type` - (provider: [LocalTreeDataProvider](/refs/Class/LocalTreeDataProvider){/* */}, row: number) =&gt; void

**Remarks:**

Called after data is deleted in TreeDataProvider.

If softDeleting = true, it is not called simply because the Row's State is changed to Deleted.

Occurs when the TreeDataProvider is completely deleted.

\[Parameter list\]

`provider` - TreeDataProvider control

`row` - the tree id of the data row

**Example:**


```js
dataProvider.onRowDeleted = function (provider, row) {
 console.log('dataProvider row deleted ' + row);
};
```

<hr/>

### onRowDeleting

A callback that determines row deletion

`Type` - (provider: [LocalTreeDataProvider](/refs/Class/LocalTreeDataProvider){/* */}, row: number) =&gt; boolean

**Remarks:**

Called to TreeDataProvider before data is deleted.

\[Parameter list\]

`provider` - TreeDataProvider control

`row` - the tree id of the data row

**Example:**


```js
dataProvider.onRowDeleting = function (provider, row) {
 if (row < 100) {
 return false;
 }
 return true;
};
```

<hr/>

### onRowParentChanged

Callback notifying that the parent of a row has changed

`Type` - (provider: [LocalTreeDataProvider](/refs/Class/LocalTreeDataProvider){/* */}, row: number, parent: number, index: number) =&gt; void

**Remarks:**

Occurs after the parent is changed using the [LocalTreeDataProvider.changeRowParent()](/refs/Class/LocalTreeDataProvider#changerowparent) function.

\[Parameter list\]

`provider` - TreeDataProvider control

`row` - Tree id of the data row moved

`parent` - The parent item you moved to

`index` - location index of the moved parent

**Example:**


```js
dataProvider.onRowParentChanged = function (provider, row, parent, index) {
 console.log('parent row changed to ' + parent);
};
```

<hr/>

### onRowParentChanging

A callback that determines whether to change the parent of a row

`Type` - (provider: [LocalTreeDataProvider](/refs/Class/LocalTreeDataProvider){/* */}, row: number, parent: number, index: number) =&gt; boolean

**Remarks:**

This occurs when you try to change the parent using the [LocalTreeDataProvider.changeRowParent()](/refs/Class/LocalTreeDataProvider#changerowparent) function.

\[Parameter list\]

`provider` - TreeDataProvider control

`row` - the tree id of the data row you want to move

`parent` - the parent item you want to move to

`index` - Position index of the parent you want to move to

**Example:**


```js
dataProvider.onRowParentChanging = function (provider, row, parent, index) {
 if (row % 2 === 0) {
 return true;
 }
 return false;
};
```

<hr/>

### onRowsAdded

Callback notifying that rows have been added

`Type` - (provider: [LocalTreeDataProvider](/refs/Class/LocalTreeDataProvider){/* */}, parent: number, rows: number\[\]) =&gt; void

**Remarks:**

Called after data is added to TreeDataProvider.

\[Parameter list\]

`provider` - TreeDataProvider control

`parent` - the id of the parent

`rows` - tree ids of data rows

**Example:**


```js
dataProvider.onRowsAdded = function (provider, parent, rows) {
 console.log("DataProvider row added at " + parent + " as " + rows.join(", "));
};
```

<hr/>

### onRowsDeleted

Callback notifying that rows have been deleted

`Type` - (provider: [LocalTreeDataProvider](/refs/Class/LocalTreeDataProvider){/* */}, rows: number\[\]) =&gt; void

**Remarks:**

Called after data rows are deleted in TreeDataProvider.

\[Parameter list\]

`provider` - TreeDataProvider control

`rows` - tree ids of data rows

**Example:**


```js
dataProvider.onRowsDeleted = function (provider, rows) {
 console.log('DataProvider rows deleted: ' + rows.join(', '));
};
```

<hr/>

### onRowSiblingMoved

lineA callback indicating that a sibling has been moved between siblings.

`Type` - (provider: [LocalTreeDataProvider](/refs/Class/LocalTreeDataProvider){/* */}, row: number, offset: number) =&gt; void

**Remarks:**

Called when the position between siblings changes using the [LocalTreeDataProvider.moveRowSibling()](/refs/Class/LocalTreeDataProvider#moverowsibling) function.

\[Parameter list\]

`provider` - TreeDataProvider control

`row` - Tree id of the data row moved

`offset` - upper and lower position step value

**Example:**


```js
dataProvider.onRowSiblingMoved = function (provider, row, offset) {
 console.log('sibling row moved on: ' + row);
};
```

<hr/>

### onRowSiblingMoving

Callback to determine movement of rows between siblings

`Type` - (provider: [LocalTreeDataProvider](/refs/Class/LocalTreeDataProvider){/* */}, row: number, offset: number) =&gt; boolean

**Remarks:**

[LocalTreeDataProvider.moveRowSibling()](/refs/Class/LocalTreeDataProvider#moverowsibling) Called when changing the position between siblings using the function.

\[Parameter list\]

`provider` - TreeDataProvider control

`row` - the tree id of the data row you want to move

`offset` - upper and lower position step value

**Example:**


```js
dataProvider.onRowSiblingMoving = function (provider, row, offset) {
 if (row % 2 === 0) {
 return true;
 }
 return false;
};
```

<hr/>

### onRowsSiblingMoved

Callback notifying that siblings have been moved using dragAndDrop

`Type` - (provider: [LocalTreeDataProvider](/refs/Class/LocalTreeDataProvider){/* */}, rows: number\[\], offset: number) =&gt; void

**Remarks:**

Called when the positions of siblings change using mouse dragAndDrop.

\[Parameter list\]

`provider` - TreeDataProvider control

`rows` - Array of tree ids of the data rows moved

`offset` - upper and lower position step value

**Example:**


```js
dataProvider.onRowsSiblingMoved = function (provider, rows, offset) {
 console.log('sibling rows moved on: ' + rows);
};
```

<hr/>

### onRowsSiblingMoving

Callback to determine movement between siblings using DragAndDrop

`Type` - (provider: [LocalTreeDataProvider](/refs/Class/LocalTreeDataProvider){/* */}, rows: number\[\], offset: number) =&gt; boolean

**Remarks:**

Called when trying to change the position of siblings using mouse dragAndDrop.

\[Parameter list\]

`provider` - TreeDataProvider control

`rows` - array of tree ids for the data rows you want to move

`offset` - upper and lower position step value

**Example:**


```js
dataProvider.onRowsSiblingMoving = function (provider, rows, offset) {
 if (rows.length > 1) {
 return false;
 }
 return true;
};
```

<hr/>

### onRowStateChanged

Callback to notify that row state has changed

`Type` - (provider: [LocalTreeDataProvider](/refs/Class/LocalTreeDataProvider){/* */}, row: number) =&gt; void

**Remarks:**

Called after the rowState of the data row of TreeDataProvider is changed.

\[Parameter list\]

`provider` - TreeDataProvider control

`row` - the tree id of the changed data row

**Example:**


```js
dataProvider.onRowStateChanged = function (provider, row) {
 console.log('dataProvider row state changed: ' + row);
};
```

<hr/>

### onRowStatesChanged

Callback notifying that the state of multiple rows has changed

`Type` - (provider: [LocalTreeDataProvider](/refs/Class/LocalTreeDataProvider){/* */}, rows: number\[\]) =&gt; void

**Remarks:**

Called after the rowState of multiple data rows is changed in TreeDataProvider.

\[Parameter list\]

`provider` - TreeDataProvider control

`rows` - tree ids of changed data rows

**Example:**


```js
dataProvider.onRowStatesChanged = function (provider, rows) {
 console.log('dataProvider row state changed: ' + rows.join(','));
};
```

<hr/>

### onRowsUpdated

Callback to notify that multiple rows of data have changed

`Type` - (provider: [LocalTreeDataProvider](/refs/Class/LocalTreeDataProvider){/* */}, rows: number\[\]) =&gt; void

**Remarks:**

This occurs when events are collectively reflected in functions such as [updateRows](/refs/Class/LocalDataProvider#updaterows).

\[Parameter list\]

`provider` - DataProvider control

`rows` - Tree ids of changed data rows

**Example:**


```js
dataProvider.onRowsUpdated = function (provider, rows) {
 console.log("DataProvider rows updated: " + rows.join(', '));
};
```

<hr/>

### onRowsUpdating

Callbacks that determine changes to multiple rows of data

\[Parameter list\]

`provider` - DataProvider control

`rows` - Tree id of the data rows to be changed

`Type` - (provider: [LocalTreeDataProvider](/refs/Class/LocalTreeDataProvider){/* */}, rows: number\[\]) =&gt; boolean

**Example:**


```js
dataProvider.onRowsUpdating = function (provider, rows) {
 if (rows.length > 10) {
 return false;
 }
 return true;
};
```

<hr/>

### onRowUpdated

Callback notifying that a row has been modified

`Type` - (provider: [LocalTreeDataProvider](/refs/Class/LocalTreeDataProvider){/* */}, row: number) =&gt; void

**Remarks:**

Called before data is modified in TreeDataProvider.

\[Parameter list\]

`provider` - TreeDataProvider control

`row` - the tree id of the data row

**Example:**


```js
dataProvider.onRowUpdated = function (provider, row) {
 console.log("DataProvider row updated: " + row);
};
```

<hr/>
### onRowUpdating

A callback that determines row modifications

`Type` - (provider: [LocalTreeDataProvider](/refs/Class/LocalTreeDataProvider){/* */}, row: number, oldValues: [RowValues](/refs/realgrid#rowvalues){/* */}, newValues: [RowValues](/refs/realgrid#rowvalues){/* */}) =&gt; boolean

**Remarks:**

Called before data is modified in the TreeDataProvider.

\[Parameter List\]

`provider` - TreeDataProvider control

`row` - Tree id of the data row

`oldValues` - Values ​​of the existing data row

`newValues` - Values ​​of the data row to be modified

**Example:**


```js
dataProvider.onRowUpdating = function (provider, row) {
 if(row % 2 === 0) {
 console.log("DataProvider row updated: " + row);
 return true;
 }
 return false;
};
```

<hr/>

### onValueChanged

A callback that notifies that the value of the data has changed.

`Type` - (provider: [LocalTreeDataProvider](/refs/Class/LocalTreeDataProvider){/* */}, row: number, field: number) =&gt; void

**Remarks:**

Call after changing the data using [LocalTreeDataProvider.setValue()](/refs/Class/LocalTreeDataProvider#setvalue).

\[Parameter list\]

`provider` - TreeDataProvider control

`row` - The tree id of the data row whose value changed.

`field` - The index of the field.

**Example:**


```js
dataProvider.onValueChanged = function (provider, row, field) {
 console.log('DataProvider row Value changed at ' + row + ' on ' + field);
};
```

<hr/>
## Method Desc

### addChildRow

Adds a child row of the specified tree row.

**\[Parameter List\]**

`row` - number

Tree id of the specified data row. If not specified, the root row is specified.

`values` - [DataValues](/refs/realgrid#datavalues)

Array or Object of field values for the row to add

`iconIndex` - number

Index of the icon to display in the tree row. Default: -1

`hasChildren` - boolean

Whether to display the presence of children. Default: `false`{/* */}. If true, it is marked as having children.

**\[return value\] -** number

**Example:**


```js
treeProvider.addChildRow(4, ['value1', 'value2', 'value3', 'value4'], -1, true);
```

<hr/>

### changeRowParent

Moves the position of a specific data row to the lower part of the specified row.

**\[Parameter List\]**

`row` - number

Tree id of the data row

`parent` - number

The id of the specified parent row. Move to the bottom of this row.

`index` - number

position among brothers

**\[return value\] -** boolean

**Example:**


```js
dataProvider.changeRowParent(4, 1, 2);
```

<hr/>

### clearRows

Delete all rows in DataProvider.

**Example:**


```js
treeProvider.clearRows();
```

<hr/>

### fillCsvData

Loads csv data according to the specified settings and saves it to the TreeDataProvider local storage.

**\[Parameter List\]**

`data` - any

data in csv format

`options` - [DataFillOptions](/refs/Interface/DataFillOptions)

Model configuration information, such as [DataFillOptions](/refs/Interface/DataFillOptions)

**\[Return Value\] -** void

**Example:**


```js
let options = {
      start: 1,
      count: 3
}

dataProvider.fillCsvData(data, options);
```

<hr/>

### fillJsonData

Loads Json data according to the specified settings and saves it to the TreeDataProvider local storage.

**\[Parameter List\]**

`data` - any

data in json format

`options` - [DataFillOptions](/refs/Interface/DataFillOptions)

Model configuration information, such as [DataFillOptions](/refs/Interface/DataFillOptions)

**\[Return Value\] -** void

**Example:**


```js
let options = {
      start: 1,
      count: 3
}

dataProvider.fillJsonData([
  {
    FieldA: 'ABC';
    FieldB: 10
  }, {
    FieldA: 'DEF';
    FieldB: 30
  }], options);
```

<hr/>

### fillXmlData

Loads xml data according to the specified settings and saves it to the TreeDataProvider local storage.

**\[Parameter List\]**

`data` - any

data in xml format

`options` - [DataFillOptions](/refs/Interface/DataFillOptions)

Model configuration information, such as [DataFillOptions](/refs/Interface/DataFillOptions)

**\[Return Value\] -** void

**Example:**


```js
let options = {
      start: 1,
      count: 3
}

dataProvider.fillXmlData(data, options);
```

<hr/>

### getAncestors

Returns the IDs of ancestor rows of the specified row.

**\[Parameter List\]**

`row` - number

Tree id of the specified data row

**\[return value\] -** number\[\]

**Example:**


```js
let ances = treeProvider.getAncestors(4);
```

<hr/>

### getChildCount

Returns the number of child rows of the specified row.

**\[Parameter List\]**

`row` - number

Tree id of the specified data row. If -1, the number of child rows of the root row
returns

**\[return value\] -** number

**Example:**


```js
let childCount = treeProvider.getChildCount(4);
```

<hr/>

### getChildren

Returns the unique numbers of all child rows of a specified row.

**\[Parameter List\]**

`row` - number

Tree ID of the specified data row, if -1, returns the unique number of child rows of the root row.

**\[return value\] -** number\[\]

**Example:**


```js
let children = treeProvider.getChildren(4);
```

<hr/>

### getDescendantCount

Returns the number of descendant rows of the specified row.

**\[Parameter List\]**

`row` - number

Tree id of the specified data row, if -1, returns the number of descendant rows of the root row.

**\[return value\] -** number

**Example:**


```js
let descenCount = treeProvider.getDescendantCount(4);
```

<hr/>

### getDescendants

Returns the IDs of descendant rows of the specified row.

**\[Parameter List\]**

`row` - number

`maxLevel` - number

Maximum level depth that can be returned. Only rows with a level lower than the set value are returned.

**\[return value\] -** number\[\]

**Example:**


```js
let descendants = treeProvider.getDescendants(4, 2);
```

<hr/>

### getHiddenRows

Returns the numbers of hidden rows.

**Example:**


```js
let rows = treeProvider.getHiddenRows();
```

<hr/>

### getIconIndex

Returns the index of the icon displayed in the tree row.

**\[Parameter List\]**

`row` - number

Tree id of the data row

**\[return value\] -** number

**Example:**


```js
let iconIndex = treeProvider.getIconIndex(4);
```

<hr/>

### getJsonRow

Returns the specified data row as a JSON object.

**\[Parameter List\]**

`row` - number

Tree id of the specified data row

`rowState` - boolean

If `true`{/* */}, the status value of the row is added.

`recursive` - boolean

If `true`{/* */}, child nodes are included.

`childRowsProp` - string

Specifies the property name of the child property. Default: 'rows'

`iconProp` - string

Specifies the attribute name of the icon field. Default: 'iconIndex'

`level` - number

When including a child node, specify the level calculated by calculating the level of the parentNode to be included as `0`{/* */}. Default: '-1'

**\[return value\] -** any

**Example:**


```js
let jsonRow = treeProvider.getJsonRow(4);
```

<hr/>

### getJsonRows

Returns the specified data row and descendants as a JSON object.

**\[Parameter List\]**

`row` - number

Tree id of the specified data row, if not specified or rowId is specified as null, data from the root row is retrieved.

`recursive` - boolean

Whether to include descendants. Default: false

`childRowsProp` - string

Specifies the property name of the child property. Default: 'rows'

`iconProp` - string

Specifies the attribute name of the icon field. Default: 'iconIndex'

`rowState` - boolean

If `true`{/* */}, the status value of the row is added.

**\[Return value\] -** object\[\]

**Example:**


```js
let jsonRow = treeProvider.getJsonRows(4, true);
```

<hr/>

### getLevel

Returns the level of the specified row.

**\[Parameter List\]**

`row` - number

Tree id of the specified data row

**\[return value\] -** number

**Example:**


```js
let level = treeProvider.getLevel(4);
```

<hr/>

### getOutputRow

Imports the specified data row as a JSON object by applying the format.

**\[Parameter List\]**

`options` - [DataOutputOptions](/refs/Interface/DataOutputOptions)

Setting information for the model, such as [DataOutputOptions](/refs/Interface/DataOutputOptions)

`row` - number

Tree id of the specified data row. If not specified, the result of the root row is returned.

`iconProp` - string

Specifies the attribute name of the icon field. Default: 'iconIndex'

**\[return value\] -** object

**Example:**


```js
let opt = {
      nullText: 'empty value'
}
let row = dataProvider.getOutputRow(opt, 4);
```

<hr/>

### getOutputRows

The specified data row and descendants are formatted and imported as a JSON object.

**\[Parameter List\]**

`options` - [DataOutputOptions](/refs/Interface/DataOutputOptions)

Setting information for the model, such as [DataOutputOptions](/refs/Interface/DataOutputOptions)

`row` - number

Tree id of the specified data row. If not specified, the result of the root row is returned.

`recursive` - boolean

Whether to include descendants. Default: `false`

`childRowsProp` - string

Specifies the property name of the child property. Default: 'rows'

`iconProp` - string

Specifies the attribute name of the icon field. Default: 'iconIndex'

**\[Return value\] -** object\[\]

**Example:**


```js
let opt = {
      nullText: 'empty value'
}
let row = dataProvider.getOutputRows(opt, 4);
```

<hr/>

### getParent

Returns the row id of the parent of the specified row.

**\[Parameter List\]**

`row` - number

Tree id of the specified data row

**\[return value\] -** number

**Example:**


```js
let p = treeProvider.getParent(4);
```

<hr/>

### getRowCount

Returns the number of stored data rows.

**Remarks:**

Returns the number of all items stored under the root.

**Example:**


```js
let rowCount = ds.getRowCount();
```

<hr/>

### getValue

Returns the value of the specified data cell.

**\[Parameter List\]**

`row` - number

Tree id of the data row

`field` - string \| number

Field name or index

**\[return value\] -** any

**Example:**


```js
let val = dataProvider.getValue(2, 10);
```

<hr/>

### hideRows

Hides the specified row or rows from the screen.

**\[Parameter List\]**

`dataRows` - number\[\] \| number

The row number or numbers you want to hide

**\[Return Value\] -** void

**Remarks:**

If remove or insert occurs in a hidden state, dataRow may change, so be careful when using it.

**Example:**


```js
// single
treeProvider.hideRows(4);

//array
treeProvider.hideRows([3,4]);
```

<hr/>

### insertChildNode

Add a child node to the specified tree row at the desired location.

**\[Parameter List\]**

`row` - number

Tree id of the specified data row. If not specified, the root row is specified.

`index` - number

The position where the row to be inserted will be placed among the children of the specified parent row.

`data` - [RowObject](/refs/realgrid#rowobject)

data in json format

`childrenProp` - string

Attribute name if there is a child node

`iconField` - string

A field containing the index of the icon to display in the tree row.

`noState` - boolean

Whether to add row status value Default value: false

**\[return value\] -** any

**Remarks:**

Used when adding tree-type data.

<hr/>

### insertChildRow

Adds a child row to the desired location among the child rows of the specified tree row.

**\[Parameter List\]**

`row` - number

Tree id of the specified data row. If not specified, the root row is specified.

`index` - number

The position where the row to be inserted will be placed among the children of the specified parent row.

`values` - [DataValues](/refs/realgrid#datavalues)

A json object with an array of field values or fields as properties.

`iconIndex` - number

Index of the icon to display in the tree row. Default: -1

`hasChildren` - boolean

Whether to display the presence of children. Default: `false`{/* */}. If `true`{/* */}, it is marked as having children.

**\[return value\] -** number

**Example:**


```js
treeProvider.insertChildRow(4, 3, ['value1', 'value2', 'value3', 'value4'], -1, true);
```

<hr/>

### isHiddenRow

Returns whether the specified row is a hidden row.

**\[Parameter List\]**

`dataRow` - number

Unique number of the specified data row

**\[return value\] -** boolean

**Example:**


```js
let isHidden = treeProvider.isHiddenRow(4);
```

<hr/>

### moveRowSibling

The position of a specific data row is moved among siblings of the same parent by a specified number of steps.

**\[Parameter List\]**

`row` - number

Tree id of the data row

`offset` - number

Specified step value

**\[return value\] -** boolean

**Example:**


```js
dataProvider.moveRowSibling(4, 1);
```

<hr/>

### removeRow

Deletes the specified data row.

**\[Parameter List\]**

`row` - number

Tree id of the data row to delete

`recursive` - boolean

**\[return value\] -** boolean

**Remarks:**

If the specified data row is an ancestor row, all descendant rows are also deleted. If the DataProvider's softDeleting is `true`{/* */}, it is not actually deleted and only the rowState is changed.

**Example:**


```js
treeProvider.removeRow(4);
```

<hr/>

### removeRows

Deletes specified data rows.

**\[Parameter List\]**

`rows` - number\[\]

Tree IDs of data rows to delete. If not specified or an empty array is entered, false is returned.

`recursive` - boolean

**\[return value\] -** boolean

**Remarks:**

If the specified data row is an ancestor row, all descendant rows are also deleted. If the DataProvider's softDeleting is `true`{/* */}, it is not actually deleted and only the rowState is changed.

**Example:**


```js
treeProvider.removeRows([1,3,4]);
```

<hr/>

### resetHiddenRows

Redisplays all hidden rows.

**Example:**


```js
treeProvider.resetHiddenRows();
```

<hr/>

### searchData

Finds cells with a specific value depending on how the search is set up.

**\[Parameter List\]**

`options` - [SearchCellOptions](/refs/Interface/SearchCellOptions)

Search method, specified by [SearchCellOptions](/refs/Interface/SearchCellOptions) model.

**\[Return value\] -** [SearchCellResult](/refs/Interface/SearchCellResult)

**Example:**


```js
ds.searchData({fields:['fieldName'], value: 'value', parentId: 3});
```

<hr/>

### searchDataRow

Depending on how the search is set up, it finds rows with a specific value.

**\[Parameter List\]**

`options` - [SearchOptions](/refs/Interface/SearchOptions)

Search method, specified by [SearchOptions](/refs/Interface/SearchOptions) model.

**\[return value\] -** number

**Example 1:**


```js
ds.searchDataRow({fields:['fieldName'], values: ['value'], parentId: 3});
```

**Example 2:**


```js
ds.searchDataRow({fields:['fieldName'], values: ['value']});
```

<hr/>

### setCsvRows

Set the tree data as new CSV data.

**\[Parameter List\]**

`rows` - string

data to set

`treeField` - string

field name

`needSorting` - boolean

`childrenField` - string

Field indicating whether there are child rows

`iconField` - string

Field name whose value is the path to the icon to be displayed in the tree node.

**\[Return Value\] -** void

**Remarks:**

Delete all existing data rows in the tree and add the CSV passed as a parameter as data rows.

**Example:**


```js
let rows = `Username; Identifier;First name;Last name
booker12;9012;Rachel;Booker
grey07;2070;Laura;Grey
johnson81;4081;Craig;Johnson
jenkins46;9346;Mary;Jenkins
smith79;5079;Jamie;Smith
`
dataProvider.setCsvRows(rows, 'number', false, '', 'icon');
```

<hr/>

### setIconIndex

Changes the icon of the specified row.

**\[Parameter List\]**

`row` - number

Tree id of the row whose icon you want to change

`iconIndex` - number

New icon index to change

**\[Return Value\] -** void

**Example:**


```js
treeProvider.setIconIndex(42, 4);
```

<hr/>

### setNestedRows

Set the tree's data to new JSON data.

**\[Parameter List\]**

`json` - any

Data to set. A Json array or an object with a Json array as a property. If it is not a Json array, the property specified in rowsProp must be specified as an array.

`rowsProp` - string

Property name of array to be used as data rows of tree in Json

`childRowsProp` - string

If the 1st level array name and the lower level array name are different, the lower level array property name

`childrenProp` - string

Attribute name indicating whether there is a child row.

`iconProp` - string

Property name whose value is the path to the icon to be displayed in the tree node.

**\[Return Value\] -** void

**Remarks:**

Delete all existing data rows in the tree and add the JSON object passed as a parameter as data rows. The difference from [LocalTreeDataProvider.setObjectRows()](/refs/Class/LocalTreeDataProvider#setobjectrows){/* */} is that childrenProp and iconProp do not need to be registered in the field.

**Example:**


```js
dataProvider.setNestedRows(rows, 'rowsProp', 'childRowsProp', 'childrenProp', 'iconProp');
```

<hr/>

### setObjectRows

Set the tree's data to new JSON data.

**\[Parameter List\]**

`json` - any

Data to set. A Json array or an object with a Json array as a property. If it is not a Json array, the property specified in rowsProp must be specified as an array.

`rowsProp` - string

In Json, a property name whose value is an array to be used as data rows in a tree.

`childrenProp` - string

Attribute name indicating whether there are child rows. The value of the property must be the same as the child's field name.

`iconProp` - string

Property name whose value is the path to the icon to be displayed in the tree node.

**\[Return Value\] -** void

**Remarks:**

Delete all existing data rows in the tree and add the JSON object passed as a parameter as data rows.

**Example:**


```js
dataProvider.setObjectRows(rows, 'rowsProp', 'childField', 'iconField');
```

<hr/>

### setRows

Set the tree data as new data.

**\[Parameter List\]**

`rows` - [DataValues](/refs/realgrid#datavalues){/* */}\[\]

data to set

`treeField` - string

field name

`needSorting` - boolean

`childrenField` - string

Field indicating whether there are child rows

`iconField` - string

Field name whose value is the path to the icon to be displayed in the tree node.

**\[Return Value\] -** void

**Remarks:**

Delete all existing data rows in the tree and add the array of arrays passed as parameters as data rows.

**Example:**


```js
dataProvider.setRows([{
          'uno', 1, 'one', 'ichi', 'ee', 'I'
      }, {
          'dos', 2, 'two', 'ni', 'er', 'II'
      }
], 'number', false, '', 'icon');
```

<hr/>

### setValue

Changes the value of a specified data cell.

**\[Parameter List\]**

`row` - number

Tree id of the data row

`field` - string \| number

Field name or index

`value` - any

**\[Return Value\] -** void

**Example:**


```js
dataProvider.setValue(2, 5, 'newValue');
```

<hr/>

### setXmlRows

Set the tree data as new XML data.

**\[Parameter List\]**

`xml` - any

data to set

`rowElement` - string

The name of the element to be used as data rows in the XML tree

`childrenField` - string

Field indicating whether there is a child row, the child field name

`iconField` - string

Field name whose value is the path to the icon to be displayed in the tree node.

**\[Return Value\] -** void

**Remarks:**

Delete all existing data rows in the tree and add the XML passed as a parameter as data rows. If you enter "row" in rowElement, the row element of the root will be used, and if you enter "row\[0\].row" in rowElement, the first row of the root will be used. "row.row" is equivalent to "row\[0\].row".

**Example:**


```js
dataProvider.setXmlRows(rows, 'number', false, '', 'icon');
```

<hr/>

### showHiddenRows

Shows hidden rows or rows on the screen.

**\[Parameter List\]**

`dataRows` - number\[\] \| number

The row number or numbers you want to show

**\[Return Value\] -** void

**Remarks:**

If filterMode, sortMode:"explicit" is used, the filter or sort will be reapplied if `showHiddenRows()`{/* */} is used. It is displayed in a collapsed state.

**Example:**


```js
// single
treeProvider.showHiddenRows(4);

//array
treeProvider.showHiddenRows([3,4]);
```

<hr/>

### updateRow

Modifies field values of the specified data row.

**\[Parameter List\]**

`row` - number

Tree id of the specified data row

`values` - [DataValues](/refs/realgrid#datavalues)

Change value. It is an array of field values, an array, or a json object.

`strict` - boolean

Fields whose values are undefined or not specified retain their existing values.

**\[return value\] -** boolean

**Example:**


```js
treeProvider.updateRow(4, ['value1', 'value2', 'value3', 'value4'], true);
```

<hr/>

### updateRows

Modifies field values of specified data rows.

**\[Parameter List\]**

`rows` - number\[\]

Array of tree ids for the specified data row

`values` - [DataValues](/refs/realgrid#datavalues){/* */}\[\]

Change value. It is an array of field values, an array, or a json object.

`strict` - boolean

If true, fields whose values are undefined or not specified retain their existing values.

**\[Return Value\] -** void

**Example:**


```js
treeProvider.updateRows([4,3], [{field1: 'value1', field2: 'value2', field2: 'value3', field4: 'value4'}, {field1: 'val1'}], true);
```

<hr/>