There are a few useful options available if running Quick Search (see the main demo here). These include:
- Styling Results
Quick Search Predefined Config enables the style of matched cells to be configured - in this example we have set a darker yellow background with a brown font and italic text.
- Placeholder Text
The default placeholder text value of 'Search' in the Quick Search box can be changed via the quickSearchPlaceholder property in Search Options; here it is set to 'Search Grid'.
- Running Parallel Query
Quick Search is a Find and Highlight operation and not a Filter one so the default behaviour is to show all rows with matching cells highlighted.
To display only those rows which contains a matching cell, set therunQueryAfterQuickSearch property in Search Optionsto true (as we have done in this demo).
- Excluding Columns From Search
By default AdapTable will search every visible column when running Quick Seach.
Particular columns can be excluded by providing a excludeColumnFromQuickSearch function in Search Options. Set it to return true for any column that you want excluded.
In this example our function will exclude the Contact Column which is why searching for 'Maria' will not show up in the result set.
- Ignoring Case
By default case is ignored when searching against string columns. This is the case for Quick Search, Filters, and Queries.
Setting the ignoreCaseInQueries property of Query Options to be false (the default if not set is true) will change this behaviour.
This example we set the value to false: type 'j' into Quick Search and note that Janet Leverling does not highlight; change that to 'J' and it will highlight.