Search bar access
While the search bar is convenient for users, performance may be impacted by searching large tables with many text columns. It is possible to add LayoutHints that control search bar access to the persistent queries of tables such as these.
To explicitly set whether the search bar is accessible for a specific table, use the setSearchBarAccess(SearchDisplayModes)
method of the LayoutHintBuilder
.
Options are:
Show
- the search bar will be shown for that table.Hide
- the search bar will be hidden for that table.Default
- the search bar will follow the systemwide default set by the propertyui.search.show
. See: Disable search
import com.illumon.iris.db.tables.utils.LayoutHintBuilder
import com.illumon.iris.db.tables.utils.LayoutHintBuilder.SearchDisplayModes
canSearch = emptyTable(5).updateView("a=`abc`").layoutHints(LayoutHintBuilder.get().setSearchBarAccess(SearchDisplayModes.Show))
cannotSearch = emptyTable(5).updateView("a=`abc`").layoutHints(LayoutHintBuilder.get().setSearchBarAccess(SearchDisplayModes.Hide))
The Show Search option will be available in the canSearch
table's column header menu as usual:
However, this option will not be displayed in the column header menu for the cannotSearch
table.