question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Search is not working

See original GitHub issue

I 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:open
  • Created 3 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
cwilso03commented, Sep 1, 2020

@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 ToolkitProvider to be providing the data, columns, and keyField properties. As written in your original post, you’re setting those properties again on the BootstrapTable instance directly.

See this page for the relevant docs.

0reactions
polixisNGcommented, Feb 21, 2022

import ToolkitProvider, { Search } from ‘react-bootstrap-table2-toolkit/dist/react-bootstrap-table2-toolkit’;

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found