react-bootstrap-table2/docs/search-props.md
2018-09-30 14:11:34 +08:00

1.0 KiB

id title
search-props Search Props

Table search in one of features supported by react-bootstrap-table2-toolkit. By passing search prop to ToolkitProvider for enabling this functionality.

Required

N/A

Optional


search.searchFormatted - [Bool]

If you want to search on the formatted data, you are supposed to enable this prop. react-bootstrap-table2 will check if you define the column.formatter when doing search.

<ToolkitProvider
  keyField="id"
  data={ products }
  columns={ columns }
  search={ {
    searchFormatted: true
  } }
>
  // ...
</ToolkitProvider>

search.defaultSearch - [String]

Accept a string that will be used for default searching when first time table render.

<ToolkitProvider
 keyField="id"
 data={ products }
 columns={ columns }
 search={ {
   defaultSearch: 'search something here'
 } }
>
 // ...
</ToolkitProvider>