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.

Global filter is not working with custom cell

See original GitHub issue
  {
    Header: 'Client Name ',
    Footer: 'Last Name',
   
    accessor: (props) => (
      <>
        <div class="text-sm text-gray-900">{props.clientname}</div>
        <div class="text-sm text-gray-600">{props.country}</div>
        <div class="text-sm text-gray-400">{props.clientstatus}</div>
      </>
    ),
  },

With custom cell (like above) global filter is not working

if i change code above to following(below) then global filter work with this cell

  {
    Header: 'Client Name ',
    Footer: 'Last Name',
   accessor: 'clinetname"
  },

is there any way to make global filter work with custom cell ?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
IHIutchcommented, Sep 30, 2021

Coming back here, it does look like you can achieve this by making your accessor an array, like so:

{
        Header: 'Client ',
        accessor: (props) => ([props.name, props.country]),
        Cell: ({ value }) => {
          const [ clientname, country ] = value
          return (
            <>
              <div class="text-sm text-gray-900">{clientname}</div>
              <div class="text-sm text-gray-600">{country}</div>
            </>
        )},
      },
1reaction
wbolduccommented, Dec 16, 2020

accessor should not return components like that

https://react-table.tanstack.com/docs/api/useTable#column-options “The data returned by an accessor should be primitive and sortable.”

Read more comments on GitHub >

github_iconTop Results From Across the Web

global filter not working with custom cell #2883 - GitHub
With custom cell (like above) global filter is not working. if i change code above to following(below) then global filter work with this ......
Read more >
Global Filter in react-table v8 isn't working - Stack Overflow
There is a current issue on GitHub where you can't use a global filter if one of your column is using number fields....
Read more >
Custom Filtering • reactable - GitHub Pages
Custom filter methods and custom filter inputs let you change how filtering is done in reactable. By default, all filter inputs are text...
Read more >
Quick start: Filter data by using an AutoFilter - Microsoft Support
Use the AutoFilter to filter a range of data in Excel 2010 and learn how to remove filters.
Read more >
Global Filtering/Search Feature Guide - Material React Table
How to use, customize, or disable the global filter and search features in Material React Table.
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