| sidebar_label | search() |
|---|---|
| title | search method |
| description | You can learn about the search method in the documentation of the DHTMLX JavaScript Spreadsheet library. Browse developer guides and API reference, try out code examples and live demos, and download a free 30-day evaluation version of DHTMLX Spreadsheet. |
@short: searches for cells by the specified parameters
The method can also open a search box in the top right corner of the spreadsheet and highlight the matched results
search(
text?: string,
openSearch?: boolean,
sheetId?: string | number
): string[];text- (optional) the value to searchopenSearch- (optional) iftrue, opens a search box and highlights cells with the matched results;falseby defaultsheetId- (optional) the ID of the sheet. By default, the method searches for cells on the currently active sheet
The method returns an array with IDs of the found cells
const spreadsheet = new dhx.Spreadsheet("spreadsheet", {});
spreadsheet.parse(data);
// returns IDs of cells with the matched result, opens a search bar and highlights the found cells
spreadsheet.search("feb", true, "Income"); // -> ['C1']Change log: Added in v5.0
Related article: Work with Spreadsheet