TabSheetDataSource.search

Syntax

search(text: String, caseSensitive: Boolean, wholeWordsOnly: Boolean, direction: PP.Ui.TabSearchDirection, target: PP.Ui.TabSearchTarget, range: PP.Ui.TabSheetRange);

Parameters

text. Search field.

caseSensitive. Optional parameter. Determining case during search.

wholeWordsOnly. Optional parameter. Determining whole word search.

direction. Optional parameter. Search direction.

target. Optional parameter. The cell property, by which search is executed.

range. The cell range, by which search is executed.

Description

The search method searches in table.

Example

To execute the example, the HTML page must contain the GridBox component named grid (see Example of Placing the GridBox Component). Find cells with the "region" word in the table and highlight them:

// Get table
var tabsheet = grid.getTabSheet();
// Get table data source
var source = grid.getTableSource();
// Set up cell search and highlight event
source.SearchCompleted.add(
    function(sender, args) {
        var result = args.SearchResult || [];
        var ranges = [];
        for (var i = 0; i < result.length; i++)
        {
            var coord = result[i];
            var range = tabsheet.getCell(coord.row, coord.column);
            ranges.push(range);
        }
        tabsheet.select(ranges);
    }
);
// Set word to search
source.search("region");

After executing the example all cells with the "region" word are highlighted:

See also:

TabSheetDataSource