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


## DataProviderBase

Base classes for [LocalDataProvider](/refs/Class/LocalDataProvider) and [LocalTreeDataProvider](/refs/Class/LocalTreeDataProvider)

**Signature:**

```typescript
export declare abstract class DataProviderBase
```

## Remarks

All properties and methods of DataProviderBase can be called only from subclasses that inherit it.

\[subclass\]

[LocalDataProvider](/refs/Class/LocalDataProvider)

[LocalTreeDataProvider](/refs/Class/LocalTreeDataProvider)

## Constructors

| Constructor | Modifiers | Description |
| --- | --- | --- |
| [(constructor)(undoable)](/refs/(constructor)) | | Constructs a new instance of the `DataProviderBase` class |

## Properties

| Property | Type | Description |
| --- | --- | --- |
| [amText](/refs/Class/DataProviderBase#amtext) | string | String corresponding to AM in data |
| [baseYear](/refs/Class/DataProviderBase#baseyear) | number | When the year of the data is 2 digits, the year based on |
| [booleanFormat](/refs/Class/DataProviderBase#booleanformat) | string | Format for parsing data into Boolean |
| [checkStates](/refs/Class/DataProviderBase#checkstates) | boolean | Whether to enable row state management |
| [commitBeforeDataEdit](/refs/Class/DataProviderBase#commitbeforedataedit) | boolean | |
| [datetimeFormat](/refs/Class/DataProviderBase#datetimeformat) | string | Format for parsing date data in text format into datetime values |
| [deletable](/refs/Class/DataProviderBase#deletable) | boolean | Whether rows can be deleted |
| [deleteCreated](/refs/Class/DataProviderBase#deletecreated) | boolean | Whether to actually delete the added row when deleting it |
| [insertable](/refs/Class/DataProviderBase#insertable) | boolean | Whether rows can be inserted |
| [pmText](/refs/Class/DataProviderBase#pmtext) | string | String corresponding to PM in data |
| [redoing](/refs/Class/DataProviderBase#redoing) | boolean | Whether redo is running |
| [restoreMode](/refs/Class/DataProviderBase#restoremode) | [RestoreMode](/refs/realgrid#restoremode) | restore mode |
| [softDeleting](/refs/Class/DataProviderBase#softdeleting) | boolean | When deleting a row, whether to change the RowState without actually deleting it |
| [strictRestore](/refs/Class/DataProviderBase#strictrestore) | boolean | Whether to recognize `undefined`{/* */}, `null`{/* */}, and empty strings as different values when restored |
| [subTypeEnabled](/refs/Class/DataProviderBase#subtypeenabled) | boolean | Whether to enable the subType property of [DataField](/refs/Interface/DataField) |
| [undoable](/refs/Class/DataProviderBase#undoable) | boolean | Whether to use undo/redo |
| [undoing](/refs/Class/DataProviderBase#undoing) | boolean | Whether undo is in progress |
| [updatable](/refs/Class/DataProviderBase#updatable) | boolean | Whether rows can be modified |
| [valuesCallback](/refs/Class/DataProviderBase#valuescallback) | [ObjectToValuesCallback](/refs/realgrid#objecttovaluescallback) | Callback called for each row when data in json format is entered into the dataProvider |

## Methods
| Method | Type | Description |
| --- | --- | --- |
| [addField(field, resetFields, calculateData)](/refs/Class/DataProviderBase#addfield) | addField(field: [DataFieldInput](/refs/realgrid#datafieldinput){/* */}, resetFields?: boolean, calculateData?: boolean): [DataField](/refs/Interface/DataField){/* */} ; | Create additional fields. |
| [beginUpdate(group)](/refs/Class/DataProviderBase#beginupdate) | beginUpdate(group?: boolean): void; | Specifies the starting point for a batch update. |
| [checkRowStates(value)](/refs/Class/DataProviderBase#checkrowstates) | checkRowStates(value: boolean): void; | Specifies whether to record row status. |
| [clearCommandStack()](/refs/Class/DataProviderBase#clearcommandstack) | clearCommandStack(): void; | Initialize the Command Stack. |
| [clearRowStates(deleteRows, rowEvents)](/refs/Class/DataProviderBase#clearrowstates) | clearRowStates(deleteRows: boolean, rowEvents?: boolean): void; | Removes the state of all rows. |
| [clearSavePoints()](/refs/Class/DataProviderBase#clearsavepoints) | clearSavePoints(): void; | Remove all recovery points. |
| [destroy()](/refs/Class/DataProviderBase#destroy) | destroy(): any; | Releases the DataProvider object from memory. |
| [endUpdate(refresh)](/refs/Class/DataProviderBase#endupdate) | endUpdate(refresh?: boolean): void; | Specifies the completion point of batch update. |
| [exportToCsv(options)](/refs/Class/DataProviderBase#exporttocsv) | exportToCsv(options: [DataExportOptions](/refs/Interface/DataExportOptions){/* */}): void; | Export the data set as a CSV file. |
| [fieldByName(name)](/refs/Class/DataProviderBase#fieldbyname) | fieldByName(name: string): [DataField](/refs/Interface/DataField){/* */}; | Returns the field corresponding to the name. |
| [getAllStateRows()](/refs/Class/DataProviderBase#getallstaterows) | getAllStateRows(): [RowStateList](/refs/Interface/RowStateList){/* */}; | Returns the index of all rows with a status value. |
| [getDataRowId(dataRow)](/refs/Class/DataProviderBase#getdatarowid) | getDataRowId(dataRow: number): number; | Gets the dataRowId managed internally. |
| [getDistinctValues(field, maxCount, sortDir)](/refs/Class/DataProviderBase#getdistinctvalues) | getDistinctValues(field: string \| number, maxCount?: number, sortDir?: [SortDirection](/refs/realgrid#sortdirection){/* */}): any\[\]; | Returns non-duplicate values of the field. |
| [getFieldCount()](/refs/Class/DataProviderBase#getfieldcount) | getFieldCount(): number; | Returns the number of currently configured fieldsets. |
| [getFieldIndex(fieldName)](/refs/Class/DataProviderBase#getfieldindex) | getFieldIndex(fieldName: string): number; | Returns the index corresponding to the field name. |
| [getFieldName(fieldIndex)](/refs/Class/DataProviderBase#getfieldname) | getFieldName(fieldIndex: number): string; | Returns the name of the field at a specific index. |
| [getFieldNames()](/refs/Class/DataProviderBase#getfieldnames) | getFieldNames(): string\[\]; | Returns the names of fields. |
| [getFields()](/refs/Class/DataProviderBase#getfields) | getFields(): [DataField](/refs/Interface/DataField){/* */}\[\]; | [DataField](/refs/Interface/DataField) Returns objects. |
| [getOptions()](/refs/Class/DataProviderBase#getoptions) | getOptions(): [DataOptions](/refs/Interface/DataOptions){/* */}; | Returns setting information. |
| [getOrgFieldName(fieldIndex)](/refs/Class/DataProviderBase#getorgfieldname) | getOrgFieldName(fieldIndex: number): string; | Returns the original name of the field at a specific index. |
| [getOrgFieldNames()](/refs/Class/DataProviderBase#getorgfieldnames) | getOrgFieldNames(): string\[\]; | Returns the original names of the fields. |
| [getRowState(row)](/refs/Class/DataProviderBase#getrowstate) | getRowState(row: number): [RowState](/refs/realgrid#rowstate){/* */}; | Returns the status of the specified row. |
| [getRowStateCount(states)](/refs/Class/DataProviderBase#getrowstatecount) | getRowStateCount(states: string \| [RowState](/refs/realgrid#rowstate) \| [RowState](/refs/realgrid#rowstate){/* */}\[\]): number; | Returns the number of data rows for each status. |
| [getSavePoints()](/refs/Class/DataProviderBase#getsavepoints) | getSavePoints(): number\[\]; | Returns all recovery points. |
| [getStateRows(rowState)](/refs/Class/DataProviderBase#getstaterows) | getStateRows(rowState?: [RowState](/refs/realgrid#rowstate){/* */}): number\[\]; | Returns data row indices with a specific status. |
| [getUpdatedCells(rows)](/refs/Class/DataProviderBase#getupdatedcells) | getUpdatedCells(rows: number\[\]): [UpdatedRow](/refs/Interface/UpdatedRow){/* */}\[\]; | Returns changed cell information of specified rows |
| [getValues(row)](/refs/Class/DataProviderBase#getvalues) | getValues(row: number): [RowValues](/refs/realgrid#rowvalues){/* */}; | Returns the values of the row. |
| [hasData(row)](/refs/Class/DataProviderBase#hasdata) | hasData(row: number): boolean; | Returns whether the row is filled with values. |
| [redo()](/refs/Class/DataProviderBase#redo) | redo(): void; | Cancel the reverted contents. |
| [removeField(field, resetFields)](/refs/Class/DataProviderBase#removefield) | removeField(field: [DataFieldInput](/refs/realgrid#datafieldinput){/* */}, resetFields?: boolean): void; | Remove field. |
| [restoreUpdatedRows(rows)](/refs/Class/DataProviderBase#restoreupdatedrows) | restoreUpdatedRows(rows: number \| number\[\]): void; | Restores the value and status of specified rows. |
| [restoreUpdatedStates(rows)](/refs/Class/DataProviderBase#restoreupdatedstates) | restoreUpdatedStates(rows: number\[\]): void; | Restores the status of specified rows. |
| [revertDeletedStates(rows)](/refs/Class/DataProviderBase#revertdeletedstates) | revertDeletedStates(rows: number \| number\[\]): void; | If [DataOptions.softDeleting](/refs/Interface/DataOptions#softdeleting){/* */} is `true`{/* */}, rows marked as [RowState.DELETED](/refs/realgrid#rowstate){/* */} are restored to their original state. |
| [rollback(savePoint)](/refs/Class/DataProviderBase#rollback) | rollback(savePoint?: number): void; | Restore data set |
| [savePoint(saveStates)](/refs/Class/DataProviderBase#savepoint) | savePoint(saveStates?: boolean): number; | Record the recovery point of the data set. |
| [setDataComparer(field, comparer)](/refs/Class/DataProviderBase#setdatacomparer) | setDataComparer(field: string \| number, comparer: [CompareFunction](/refs/realgrid#comparefunction){/* */}): void; | Sets the sorting function for a specific field. |
| [setFields(fields)](/refs/Class/DataProviderBase#setfields) | setFields(fields: [DataFieldInput](/refs/realgrid#datafieldinput){/* */}\[\]): void; | Set fieldset |
| [setOptions(options)](/refs/Class/DataProviderBase#setoptions) | setOptions(options: [DataOptions](/refs/Interface/DataOptions){/* */}): void; | Change setting information. |
| [setRowState(row, state, force)](/refs/Class/DataProviderBase#setrowstate) | setRowState(row: number, state?: [RowState](/refs/realgrid#rowstate){/* */}, force?: boolean): void; | Change the status of a specific row. |
| [setRowStates(rows, state, force, rowEvents)](/refs/Class/DataProviderBase#setrowstates) | setRowStates(rows: number\[\], state?: [RowState](/refs/realgrid#rowstate){/* */}, force?: boolean, rowEvents?: boolean): void; | Change the status of multiple rows at once. |
| [undo()](/refs/Class/DataProviderBase#undo) | undo(): void; | Reverts previously modified content. |

## Construct Desc

### (constructor)

Constructs a new instance of the `DataProviderBase` class

<hr/>

## Properties Desc

### amText

String corresponding to AM in data

`Type` - string

**Example:**


```js
ds.amText = "AM";
```

<hr/>

### baseYear

Year based on 2-digit data year

`Type` - number

**Example:**


```js
ds.baseYear = 1000;
```

<hr/>

### booleanFormat

Format for parsing data into Boolean

`Type` - string

**Example:**


```js
ds.booleanFormat = 'No: Yeah';
```

<hr/>

### checkStates

Whether row state management is enabled or not

`Type` - boolean

**Example:**


```js
ds.checkStates = false;
```

<hr/>

### commitBeforeDataEdit

> Warning: This API is now obsolete.
>
> While in edit mode, whether calling a function (e.g., `setValue()`) on another row automatically commits the previous edit.
>

`Type` - boolean

**Example:**


```js
ds.commitBeforeDataEdit = true;
```

<hr/>

### datetimeFormat

Format for parsing date data in text format into datetime values

`Type` - string

**Example:**


```js
ds.datetimeFormat = 'yyyy-MM-dd';
```

<hr/>

### deletable

Can rows be deleted?

`Type` - boolean

**Example:**


```js
ds.deletable = false;
```

<hr/>

### deleteCreated

Whether to actually delete the added row when deleting it

`Type` - boolean

**Example:**


```js
ds.deleteCreated = false;
```

<hr/>

### insertable

Whether rows can be inserted

`Type` - boolean

**Example:**


```js
ds.insertable = false;
```

<hr/>

### pmText

String corresponding to afternoon in data

`Type` - string

**Example:**


```js
ds.pmText = "afternoon";
```

<hr/>

### redoing

Whether redo is in progress

`Type` - boolean

<hr/>

### restoreMode

restoration mode

`Type` - [RestoreMode](/refs/realgrid#restoremode)

**Example:**


```js
ds.restoreMode = 'explicit';
```

<hr/>

### softDeleting

When deleting a row, whether to change the RowState without actually deleting it.

`Type` - boolean

**Example:**


```js
ds.softDeleting = false;
```

<hr/>

### strictRestore

When restoring, whether to recognize `undefined`{/* */}, `null`{/* */}, and empty strings as different values.

`Type` - boolean

**Example:**


```js
ds.strictRestore = true;
```

<hr/>

### subTypeEnabled

Whether the subType property of [DataField](/refs/Interface/DataField) is enabled or not.

`Type` - boolean

**Example:**


```js
ds.subTypeEndabled = false;
```

<hr/>

### undoable

Whether to use undo/redo

`Type` - boolean

**Example:**


```js
ds.undoable = true;
```

<hr/>

### undoing

Whether undo is in progress

`Type` - boolean


<hr/>

### updatable

Can rows be modified?

`Type` - boolean

**Example:**


```js
ds.updatable = false;
```

<hr/>

### valuesCallback

A callback called for each row when data in json format is entered into the data provider.

`Type` - [ObjectToValuesCallback](/refs/realgrid#objecttovaluescallback)

**Remarks:**


<hr/>

## Method Desc

### addField

Create additional fields.

**\[Parameter List\]**

`field` - [DataFieldInput](/refs/realgrid#datafieldinput)

Information value of the data field to be created, if it is a string, set to fieldName

`resetFields` - boolean

Whether to update field information bound to the data column

`calculateData` - boolean

Whether to recalculate calculated fields

**\[Return Value\] -** [DataField](/refs/Interface/DataField)

**Remarks:**

Create a [DataField](/refs/Interface/DataField) object and add it to the existing fieldset.

**Example:**


```js
// string
ds.addField('fieldName');

// model
let fields = ds.getFields();
ds2.addField(fields);

//config
ds.addField({
      fieldName: 'OrderID',
      dataType: 'text',
});
```

<hr/>

### beginUpdate

Specifies the starting point of batch update.

**\[Parameter List\]**

`group` - boolean

If set to true, a command group will be started when beginUpdate is called.

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

**Remarks:**

When a change operation occurs in the DataProvider, it is processed by passing an event to the View. During batch processing, events occur frequently, which can reduce performance. When beginUpdate() is called, the event does not occur until [endUpdate()](/refs/Class/DataProviderBase#endupdate) is called, and it occurs all at once when endUpdate() is called. beginUpdate \~ endUpdate can be nested, but must be called in pairs, and the event is delivered to the View when endUpdate of the last pair is called.

**Example:**


```js
dataProvider.beginUpdate(true);
try {
     for (var i = 0; i < 10; i++) {
         var values = gridView.getValues(i);
         dataProvider.addRow(values);
     }
} finally {
     dataProvider.endUpdate();
}
```

<hr/>

### checkRowStates

Specifies whether to record row status.

**\[Parameter List\]**

`value` - boolean

Whether to record row status

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

**Remarks:**

Determines whether to record the status when the row add/edit/delete status changes. If it is not recorded, it is ignored and deleted even if [softDeleting](/refs/Class/DataProviderBase#softdeleting) is `true`{/* */}.

**Example:**


```js
let checkState = ds.checkRowStates(true);
```

<hr/>

### clearCommandStack

Initialize the Command Stack.

**Example:**


```js
ds.clearCommandStack();
```

<hr/>

### clearRowStates

Removes the state of all rows.

**\[Parameter List\]**

`deleteRows` - boolean

Whether to actually delete a row whose row status is deleted. If `true`{/* */}, it is removed from the data set. If `false`{/* */}, the row state is reset and the data is preserved.

`rowEvents` - boolean

Whether to generate state change callbacks such as [onRowStateChanged](/refs/Class/LocalDataProvider#onrowstatechanged) for rows whose state has been removed.

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

**Remarks:**

Initializes the state of all data rows to [RowState.NONE](/refs/realgrid#rowstate).

**Example:**


```js
ds.clearRowState(true);
```

<hr/>

### clearSavePoints

Remove all recovery points.

**Remarks:**

Deletes all recovery points and related saved data and status.

**Example:**


```js
ds.clearSavePoints();
```

<hr/>

### destroy

Releases the DataProvider object from memory.

**Remarks:**

Remove objects and data used inside the DataProvider and enable garbage collection.

**Example:**


```js
ds.destroy();
```

<hr/>

### endUpdate

Specifies the completion point of batch update.

**Remarks:**

When a change operation occurs in the DataProvider, it is processed by passing an event to the View. During batch processing, events occur frequently, which can reduce performance. When [beginUpdate()](/refs/Class/DataProviderBase#beginupdate) is called, the event does not occur until endUpdate() is called, and it occurs all at once when endUpdate() is called. beginUpdate \~ endUpdate can be nested, but must be called in pairs, and the event is delivered to the View when endUpdate of the last pair is called.

**Example:**


```js
dataProvider.beginUpdate(true);
try {
     for (var i = 0; i < 10; i++) {
         var values = gridView.getValues(i);
         dataProvider.addRow(values);
     }
} finally {
     dataProvider.endUpdate();
}
```

<hr/>

### exportToCsv

Export the data set as a CSV file.

**\[Parameter List\]**

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

Export Settings

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

**Remarks:**

Depending on the options settings, the data saved in the data set is exported to a CSV file.

Since this is an export at the data level, it is carried out regardless of the status set in the View.

**Example:**


```js
ds.exportToCsv();
```

<hr/>

### fieldByName

Returns the field corresponding to the name.

**\[Parameter List\]**

`name` - string

The value corresponding to the fieldName of the field

**\[Return Value\] -** [DataField](/refs/Interface/DataField)

**Example:**


```js
let field = ds.fieldByName('Fruits');
```

<hr/>

### getAllStateRows

Returns the index of all rows with a status value.

**Remarks:**

[RowState.NONE](/refs/realgrid#rowstate) Arranges the numbers of non-rows by state and returns them in Object form.

**Example:**


```js
let rows = ds.getAllStateRows();
```

<hr/>

### getDataRowId

Gets the internally managed dataRowId.

**\[Parameter List\]**

`dataRow` - number

dataRow

**\[Return Value\] -** number

**Remarks:**

Internal dataRowId that does not change even when adding/deleting rows

<hr/>

### getDistinctValues

Returns non-duplicate values of the field.

**\[Parameter List\]**

`field` - string \| number

Field name or field index

`maxCount` - number

Maximum number of cases, sorted, cut by the number of cases from the top and returned. Default: `-1`

`sortDir` - [SortDirection](/refs/realgrid#sortdirection)

sorting method,Default: [SortDirection.ASCENDING](/refs/realgrid#sortdirection)

**\[Return Value\] -** any\[\]

**Remarks:**

Returns the values corresponding to the specified field in the data set in a sorted state, excluding duplicates.

**Example:**


```js
ds.getDistinctValues('field1');
```

<hr/>

### getFieldCount

Returns the number of currently configured fieldsets.

**Example:**


```js
let fCount = ds.getFieldCount();
```

<hr/>

### getFieldIndex

Returns the index corresponding to the field name.

**\[Parameter List\]**

`fieldName` - string

Field names are not case sensitive.

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

**Example:**


```js
let index = ds.getFieldIndex('fieldName');
```

<hr/>

### getFieldName

Returns the name of the field at a specific index.

**\[Parameter List\]**

`fieldIndex` - number

field index

**\[return value\] -** string

**Remarks:**

Returns the fieldName property of the field located at fieldIndex in the fieldset.

Since fieldName is internally stored in uppercase letters, it is output as an uppercase string.

To retrieve the fieldName at the time of setting, use [getOrgFieldName()](/refs/Class/DataProviderBase#getorgfieldname).

**Example:**


```js
let fieldName = ds.getFieldName(3);
```

<hr/>

### getFieldNames

Returns the names of fields.

**Remarks:**

Returns the fieldName properties of fields in a fieldset as an array.

Since fieldName is internally stored in uppercase letters, it is output as an uppercase string.

To retrieve the fieldName at the time of setting, use [getOrgFieldNames()](/refs/Class/DataProviderBase#getorgfieldnames).

**Example:**


```js
let fieldNames = ds.getFieldNames();
```

<hr/>

### getFields

[DataField](/refs/Interface/DataField) Returns objects.

**Remarks:**

Returns the DataField object set in the current DataProvider as an array.

**Example:**


```js
let fields = ds.getFields();
ds2.setFields(fields);
```

<hr/>

### getOptions

Returns setting information.

**Remarks:**

Setting information is returned in the form of [DataOptions](/refs/Interface/DataOptions).

**Example:**


```js
let options = ds.getOptions();
options. undoable = true;
ds.setOptions(options);
```

<hr/>

### getOrgFieldName

Returns the original name of the field at a specific index.

**\[Parameter List\]**

`fieldIndex` - number

index of field

**\[return value\] -** string

**Example:**


```js
let fieldName = ds.getOrgFieldName(3);
```

<hr/>

### getOrgFieldNames

Returns the original names of the fields.

**Example:**


```js
let orgFieldNames = ds.getOrgFieldNames();
```

<hr/>

### getRowState

Returns the status of the specified row.

**\[Parameter List\]**

`row` - number

Unique row number in the data set

**\[Return Value\] -** [RowState](/refs/realgrid#rowstate)

**Example:**


```js
let rowState = ds.getRowState(4);
```

<hr/>

### getRowStateCount

Returns the number of data rows for each status.

**\[Parameter List\]**

`states` - string \| [RowState](/refs/realgrid#rowstate) \| [RowState](/refs/realgrid#rowstate){/* */}\[\]

If you want to know the status of a row, an array of statuses if there are multiple, or all statuses, use the string 'all' or '\*'.

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

**Remarks:**

Returns the number of rows for each status included according to the specified status array or string.

When `'*'`{/* */}, `'all'` is entered, all are returned.

**Example:**


```js
var allStateCount = dataProvider.getRowStateCount('all');
var updateCount = dataProvider.getRowStateCount(RealGrid.RowState.UPDATED);
```

<hr/>

### getSavePoints

Returns all recovery points.

**Remarks:**

Returns the indices of all saved recovery points as an array.

**Example:**


```js
ds.getSavePoints([0, 1, 2]);
```

<hr/>

### getStateRows

Returns data row indices with a specific status.

**\[Parameter List\]**

`rowState` - [RowState](/refs/realgrid#rowstate)

Row state, [RowState](/refs/realgrid#rowstate) model

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

**Remarks:**

Returns the indices of rows with the specified rowState value as an array.

**Example:**


```js
let rows = ds.getStateRows('c');
```

<hr/>

### getUpdatedCells

Returns changed cell information for specified rows.

**\[Parameter List\]**

`rows` - number\[\]

Array of rows from which to retrieve information on changed cells. If `null`{/* */}, returns information on all rows whose status is [RowState.UPDATED](/refs/realgrid#rowstate){/* */} .

**\[Return value\] -** [UpdatedRow](/refs/Interface/UpdatedRow){/* */}\[\]

**Remarks:**

When the restoreMode property is [RestoreMode.EXPLICIT](/refs/realgrid#restoremode) or AUTO, information on cells in which the value of each specified row has changed is returned.

**Example:**


```js

let cells = ds.getUpdatedCells([1]);

// converted data example)
[
   {
     __rowId: 1;
     updatedCells: [
       {
         fieldName: 'OrderID',
         oldValue: '1002',
         newValue: '1003',
       },
       {
         fieldName: 'OrderCount',
         oldValue: 20;
         newValue: 30
       }
     ]
   }
]
```

<hr/>

### getValues

Returns the values of the row.

**\[Parameter List\]**

`row` - number

Unique row number of data set

**\[Return Value\] -** [RowValues](/refs/realgrid#rowvalues)

**Remarks:**

Returns the values of the corresponding data row as an array.

**Example:**


```js
let val = ds.getValeus(5);
```

<hr/>

### hasData

Returns whether the row is filled with values.

**\[Parameter List\]**

`row` - number

Unique row number in the dataset

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

**Remarks:**

Returns whether the specified data row is filled with values or is empty.

**Example:**


```js
let has = ds.hasData(5);
```

<hr/>

### redo

Cancel the reverted contents.

**Example:**


```js
ds.redo();
```

<hr/>

### removeField

Remove field.

**\[Parameter List\]**

`field` - [DataFieldInput](/refs/realgrid#datafieldinput)

Name of the field or DataField object to remove

`resetFields` - boolean

Whether to update field information bound to the data column

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

<hr/>

### restoreUpdatedRows

Restores the value and status of specified rows.

**\[Parameter List\]**

`rows` - number \| number\[\]

Index or array of indices of the row you want to restore

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

**Remarks:**

When the restoreMode property is [RestoreMode.EXPLICIT](/refs/realgrid#restoremode) or AUTO, the changes and status of the specified rows are restored to their original state.

**Example:**


```js
ds.restoreUpdatedRows([2, 4]);
```

<hr/>

### restoreUpdatedStates

Restores the status of specified rows.

**\[Parameter List\]**

`rows` - number\[\]

Array of data row indices whose state you want to restore

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

**Remarks:**

When the restoreMode property is [RestoreMode.EXPLICIT](/refs/realgrid#restoremode){/* */}, the state of the row whose value has been changed is restored. For example, if you edit a row whose state is [RowState.NONE](/refs/realgrid#rowstate) and change it to [RowState.UPDATED](/refs/realgrid#rowstate), then call it after the row's value returns to its original state. The state is restored to [RowState.NONE](/refs/realgrid#rowstate){/* */}. When restoreMode is AUTO, it is automatically restored according to row values.

**Example:**


```js
ds.restoreUpdatedStates([2, 4]);
```

<hr/>

### revertDeletedStates

If [DataOptions.softDeleting](/refs/Interface/DataOptions#softdeleting){/* */} is `true`{/* */}, rows marked as [RowState.DELETED](/refs/realgrid#rowstate){/* */} are restored to their original state.

**\[Parameter List\]**

`rows` - ​​number \| number\[\]

An array of data row indices to restore.

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

**Example:**

```js
ds.revertDeletedStates([0, 1]);
```

<hr/>

### rollback

Restore the data set

**\[Parameter List\]**

`savePoint` - number

Index of recovery point, default: 0

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

**Remarks:**

Returns the data and status of the data set to the point in time.

**Example:**


```js
ds.rollback();
```

<hr/>

### savePoint

Record the recovery point of the data set.

**\[Parameter List\]**

`saveStates` - boolean

Status recorded?

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

**Remarks:**

Copies and stores the data and state of the data set and returns the index of the point. After this, you can return to a specific point through the [rollback()](/refs/Class/DataProviderBase#rollback) function.

**Example:**


```js
ds.savePoint([2, 4]);
```

<hr/>

### setDataComparer

Sets the sorting function for a specific field.

**\[Parameter List\]**

`field` - string \| number

Name or index of the field to specify sorting method

`comparer` - [CompareFunction](/refs/realgrid#comparefunction)

custom sort function

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

**Remarks:**

When sorting of the field occurs, set a user-defined sort function rather than the sort function used by default. The sort function is identical to the compareFunction of JavaScript Array.prototype.sort().

**Example:**


```js
dataProvider.setDataComparer('OrderID', function(field, row1, row2) {
   var val1 = dataProvider.getValue(row1, field);
   var val2 = dataProvider.getValue(row2, field);
   return val1 == val2 ? 0 : val1 > val2 ? 1:-1;
}
```

<hr/>

### setFields

Set the fieldset

**\[Parameter List\]**

`fields` - [DataFieldInput](/refs/realgrid#datafieldinput){/* */}\[\]

Array of information in the DataField to be created

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

**Remarks:**

Deletes existing field information and bound data and constructs a new field set from the received field information array. Creates [DataField](/refs/Interface/DataField) objects as many as the number of fields. If the element is a string, it is created by fieldName. If the element is a DataField, it is duplicated. If the element is [DataFieldObject](/refs/Interface/DataFieldObject), it is created based on the property value. do.

**Example:**


```js
// string
ds.setFields('fieldName');

// model
let fields = ds.getFields();
ds.setFields(fields);

//config
ds.setFields({
      fieldName: 'OrderID',
      dataType: 'text',
});
```

<hr/>

### setOptions

Change setting information.

**\[Parameter List\]**

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

[DataOptions](/refs/Interface/DataOptions) Setting information object

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

**Remarks:**

Settings not entered in options retain their original values.

**Example:**


```js
let options = {
     insertable: true;
     updatable: true;
     softDeleting: false
};
ds.setOptions(options);
```

<hr/>

### setRowState

Change the status of a specific row.

**\[Parameter List\]**

`row` - number

Index of the data row whose state will be changed

`state` - [RowState](/refs/realgrid#rowstate)

State to change, default: [RowState.NONE](/refs/realgrid#rowstate)

`force` - boolean

Applies regardless of DataProvider's state management; default: `false`

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

**Example:**


```js
ds.setRowState(5, 'updated');
```

<hr/>

### setRowStates

Change the status of multiple rows at once.

**\[Parameter List\]**

`rows` - number\[\]

Array of data row indices to change state

`state` - [RowState](/refs/realgrid#rowstate)

state to change

`force` - boolean

Applies regardless of DataProvider's state management

`rowEvents` - boolean

If `true`{/* */}, a state change event for each data row occurs. If `false`{/* */}, it occurs as a single event.

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

**Remarks:**

Batch changes the status of data rows passed in an array.

**Example:**


```js
ds.setRowStates([1,3,5], "updated");
```

<hr/>

### undo

Reverts previously modified content.

**Example:**


```js
ds.undo();
```

<hr/>