addCellToSearchResult(cell, noRerender);
cell. PP.Ui.TabSheetCell / PP.Ui.TabSheetCoord / PP.Ui.TabSheetRange / Object {rowIndex, colIndex}. Cell coordinates.
noRerender. Boolean. Indicates whether to rerender component. If the value is False, the component is rerendered, if the value is True, the component is not rerendered.
The addCellToSearchResult method adds a cell to search results.
To determine search results style, use the TabSheetSettings.SearchResultStyle property.
To execute the example, the HTML page must contain a component named tabSheet (see Example of Creating the TabSheet Component). Add cells to search results and set a separate style for them by entering the following code in the console:
// Set cell coordinates
cell1 = {rowIndex: "0", colIndex: "0"};
cell2 = {rowIndex: "1", colIndex: "1"};
cell3 = {rowIndex: "2", colIndex: "2"};
// Set highlighting of search result cells
style = {
Fill: {
"@C" : "red" // Cell fill
}
};
tabSheet.setSearchResultStyle(style);
// Add cells to search results
tabSheet.addCellToSearchResult(cell1);
tabSheet.addCellToSearchResult(cell2);
tabSheet.addCellToSearchResult(cell3, true); // Do not render highlighting
As a result, three cells are added to search results, but only two of them are rendered.
Remove the second cell from search results an rerender the changes:
tabSheet.removeCellFromSearchResult(cell2, true); tabSheet.liteRerender();
Remove highlighting of search results:
tabSheet.clearSearchResult();
After executing the example highlighting of search result cells is set, then removed.
See also: