The default Searchbar has no
Answered my own question. For the benefit of others this may help in future, here's how I did it (note disabled lines won't be necessary unless you are using eslint):
import React from 'react';
const TableSearchBar = (props) => {
let input;
const handleChange = () => {
props.onSearch(input.value); //eslint-disable-line
};
return (
<div>
<label htmlFor="table-search-bar" className="w-100">
<span className="sr-only">Search This Data Table</span>
<input
id="table-search-bar"
className="form-control form-control-sm"
ref={n => input = n} //eslint-disable-line
type="text"
placeholder="Search"
onChange={handleChange}
/>
</label>
</div>
);
};
export default TableSearchBar;
I think react-bootstrap-table2 already support a lots of way to let developer to custom the search bar, export csv button, pagination etc. here is an example to show how to completely custom a search component.
@AllenFang Any examples on how to do the same with pagination? I didn't see a full customization in the docs.
@AllenFang Also the dropdown filters that can be added to table columns - I need a way to customize those so I can add a
@AllenFang Thanks for pointing me in the right direction. Is there a way to create a custom filter dropdown so I can add a
Most helpful comment
Answered my own question. For the benefit of others this may help in future, here's how I did it (note disabled lines won't be necessary unless you are using eslint):