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


## SearchOptions

Flexible configuration information model for row retrieval

**Signature:**

```typescript
export interface SearchOptions
```

## Remarks

Used in [GridBase.searchItem()](/refs/Class/GridBase#searchitem){/* */}.

When used in [LocalDataProvider.searchDataRow()](/refs/Class/LocalDataProvider#searchdatarow){/* */}, [LocalTreeDataProvider.searchDataRow()](/refs/Class/LocalTreeDataProvider#searchdatarow), filtered or row grouped In this case, hidden rows are not found.

## Example


```js
function searchItemHandler() {
     let values = ["PR20012392", "QF24212112"]
     let fields = [ "RequestType", "ServiceCode" ];
     let startFieldIndex = fields.indexOf(grid.getCurrent().fieldName) + 1;
     let options = {
          fields : fields,
          values: values,
          startIndex: grid.getCurrent().itemIndex,
          startFieldIndex : startFieldIndex,
          wrap : true,
          caseSensitive : false;
          partialMatch : true
     }
     let index = grid.searchCell(options);
     grid.setCurrent(index);
}
```

## Events

| Property | Type | Description |
| --- | --- | --- |
| [compareCallback](/refs/Interface/SearchOptions#comparecallback) | [CompareCallback](/refs/realgrid#comparecallback) | Callbacks for custom conditions |

## Properties

| Property | Type | Description |
| --- | --- | --- |
| [allFields](/refs/Interface/SearchOptions#allfields) | boolean | Whether to search all fields that meet the conditions |
| [caseSensitive](/refs/Interface/SearchOptions#casesensitive) | boolean | Whether to search case sensitively |
| [fields](/refs/Interface/SearchOptions#fields) | string\[\] | List of fields to search |
| [parentId](/refs/Interface/SearchOptions#parentid) | number | It can only be used in the row-specific number of the parent tree [LocalTreeDataProvider](/refs/Class/LocalTreeDataProvider#searchdatarow). |
| [partialMatch](/refs/Interface/SearchOptions#partialmatch) | boolean | Whether to search also for inclusion |
| [reverse](/refs/Interface/SearchOptions#reverse) | boolean | Search in reverse order. |
| [select](/refs/Interface/SearchOptions#select) | boolean | Whether to focus the searched row |
| [startIndex](/refs/Interface/SearchOptions#startindex) | number | Search start row |
| [values](/refs/Interface/SearchOptions#values) | string\[\] | Search condition values arranged in the order corresponding to each field specified in fields |
| [wrap](/refs/Interface/SearchOptions#wrap) | boolean | If there are no corresponding rows until the last row, whether to search again from the first row |

## Events Desc

### compareCallback

Callbacks for custom conditions

`Type` - [CompareCallback](/refs/realgrid#comparecallback)

**Example:**


```js
const f = function(v1, v2, sensitive, partialMatch) {
 if (v1 === v2) {
 return true;
 }
 let s1 = String(v1);
 let s2 = v2 == null ? undefined : String(v2);
 if (!s1 && !s2) {
 return true;
 }
 if (!s1 || !s2) {
 return false;
 }
 if (!caseSensitive) {
 s1 = s1.toLowerCase();
 s2 = s2.toLowerCase();
 }
 if (partialMatch) {
  return s2.indexOf(s1) >= 0;
 } else {
  return s1 == s2;
 }
}

let options = {
 fields : fields,
 values : values,
 compareCallback: f
}

let index = grid.searchItem(options);
```

<hr/>

## Properties Desc

### allFields

Whether to search all fields that meet the conditions

`Type` - boolean

**Remarks:**

If `false`{/* */}, the search ends if a matching field is found among the specified fields.

<hr/>

### caseSensitive

Whether to search case sensitively

`Type` - boolean

<hr/>

### fields

List of fields to search

`Type` - string\[\]

**Remarks:**

Can be specified by field name or field index.

<hr/>

### parentId

It can only be used in the row-specific number of the parent tree [LocalTreeDataProvider](/refs/Class/LocalTreeDataProvider#searchdatarow).

`Type` - number

<hr/>

### partialMatch

Whether to also search for inclusions

`Type` - boolean

<hr/>

### reverse

Search in reverse order.

`Type` - boolean

**Remarks:**

If `reverse`{/* */} is `true`{/* */}, the above row is searched based on startIndex.

<hr/>

### select

Whether the searched row is focused or not

`Type` - boolean

**Remarks:**

If specified as `true`{/* */}, the searched row will be selected if it exists, and if it is outside the currently displayed range, it will be scrolled to be displayed.

Can only be used in [GridBase.searchItem()](/refs/Class/GridBase#searchitem).

<hr/>

### startIndex

Search start row

`Type` - number

<hr/>

### values

Search condition values arranged in the order corresponding to each field specified in fields.

`Type` - string\[\]

<hr/>

### wrap

If there are no corresponding rows until the last row, whether to search again from the first row.

`Type` - boolean

<hr/>