To search for your specified text string or number, use the
search method to search the text in cells with the specified criteria, as shown in the following example:
6, 10, 'testSearch');
var searchCondition = new GC.Spread.Sheets.Search.SearchCondition();
searchCondition.searchString = 'testSearch';
var searchresult = sheet.search(searchCondition);
If you want to customize the search condition, set the
this.sheet.getCell( 3, 3).text( 'Demo string for search');
var condition = new GC.Spread.Sheets.Search.SearchCondition();
condition.searchString = 'for';
condition.startSheetIndex = 0;
condition.endSheetIndex = 0;
condition.searchFlags = GC.Spread.Sheets.Search.SearchFlags.ignoreCase | GC.Spread.Sheets.Search.SearchFlags.blockRange;
condition.searchOrder = GC.Spread.Sheets.Search.SearchOrder.nOrder;
condition.searchTarget = GC.Spread.Sheets.Search.SearchFoundFlags.cellText;
condition.sheetArea = GC.Spread.Sheets.SheetArea.viewport;
condition.rowStart = 0;
condition.columnStart = 0;
condition.rowEnd = 10;
condition.columnEnd = 10;
var result = this.spread.search(condition);
After you search for something, you can get a search result. The search result is an object, which contains the following properties:
searchFoundFlag: An enumeration that specifies what is matched.
foundSheetIndex: The index of the sheet in which a match is found.
foundRowIndex: The index of the row at which a match is found.
foundColumnIndex: The index of the column at which a match is found.
foundString: The found string.