Search is not working
See original GitHub issueI started working with react-bootstrap-table-next this morning and everything went really well until i got to the search. The search box appears but does not filter any records. This is what i have installed: react-bootstrap-table-next 4.0.3", react-bootstrap-table2-paginator 2.1.2", react-bootstrap-table2-toolkit 2.1.3",
Here’s my code:
import BootstrapTable from 'react-bootstrap-table-next';
import 'react-bootstrap-table-next/dist/react-bootstrap-table2.min.css';
import paginationFactory from 'react-bootstrap-table2-paginator';
import ToolkitProvider, { Search } from 'react-bootstrap-table2-toolkit';
actionFormat(cell, row, rowIndex) {
return (<div><span className='fa fa-pencil-square-o' onClick={() => this.props.parentEdit(cell, row, rowIndex)} data-id={cell} title='Edit'></span>
<span className='fa fa-trash-o' data-id={cell} onClick={() => this.props.parentDelete(cell, row, rowIndex)} title='Delete'></span></div>)
}
render() {
const { SearchBar } = Search;
return (
<Container fluid>
<ToolkitProvider
keyField="Id"
data={this.state.data}
columns={this.props.columns}
search
bootstrap4
>
{
props => (
<div>
Search:
<SearchBar {...props.searchProps} />
<BootstrapTable bootstrap4 data={this.state.data} columns={this.props.columns} keyField='Id'
pagination={paginationFactory()} striped condensed>
</BootstrapTable>
</div>
)
}
</ToolkitProvider>
);
}
Any idea why the search is not executing?
Issue Analytics
- State:
- Created 3 years ago
- Comments:5
Top Results From Across the Web
Windows 10 Search Not Working? Try These Fixes - Lifewire
When Windows search isn't working, it's almost always a simple software problem. The system may just need a restart to get it working...
Read more >How to fix search problems in Windows 10
If you're having problems searching on Windows 10 and restarting your device doesn't resolve the problem, then you can use the Troubleshooter ......
Read more >[FIXED] Windows Search Not Working | 6 Reliable Solutions
How to Fix Windows Search Not Working? · End Cortana process. · Restart the Search service. · Rebuild the Index. · Run System...
Read more >Google app won't display search results - Android
Google app won't display search results · 1. Make sure your device isn't in Airplane mode · 2. Check your Wi-Fi connection ·...
Read more >10 Ways to Fix the Windows Search Bar Not Showing or ...
10 Ways to Fix the Windows Search Bar Not Showing or Working on Windows 11 · 1. Check If the Windows Search Bar...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@cb29960 I believe you need to change your properties assignment on your
<BootstrapTable>component to be something like this:<BootstrapTable bootstrap4 pagination={paginationFactory()} striped condensed {...props.baseProps} />Essentially, you want the
ToolkitProviderto be providing thedata,columns, andkeyFieldproperties. As written in your original post, you’re setting those properties again on theBootstrapTableinstance directly.See this page for the relevant docs.
import ToolkitProvider, { Search } from ‘react-bootstrap-table2-toolkit/dist/react-bootstrap-table2-toolkit’;