React-table: Is there possible for without case sensitive in column search?????

Created on 22 Jun 2017  Â·  5Comments  Â·  Source: tannerlinsley/react-table

Is there possible for case sensitive search in column search?????

Most helpful comment

This is what we are using for a custom filter... it is not case sensitive, and also searches full text instead of just the start of the word:

customFilter = (filter, row) => {
    const id = filter.pivotId || filter.id;
    if (row[id] !== null && typeof row[id] === "string") {
      return (row[id] !== undefined
        ? String(row[id].toLowerCase()).includes(filter.value.toLowerCase())
        : true);
    }
  }

and then when calling <ReactTable />:

defaultFilterMethod={this.customFilter}

Hope that helps.

All 5 comments

I do believe the standard filter method is case sensitive?

Thanks for giving reply.then is there any way to get without case
sensitive????

On Jun 22, 2017 12:33 PM, "cbll" notifications@github.com wrote:

I do believe the standard filter method is case sensitive?

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/tannerlinsley/react-table/issues/356#issuecomment-310294330,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AUAFhTBryb7xicLD0W7p6YdjrBLQEv8Aks5sGhHOgaJpZM4OB3mi
.

Ease on the questionmarks man :)

Yes, just search the issues, it's been brought up a lot of times.

This is what we are using for a custom filter... it is not case sensitive, and also searches full text instead of just the start of the word:

customFilter = (filter, row) => {
    const id = filter.pivotId || filter.id;
    if (row[id] !== null && typeof row[id] === "string") {
      return (row[id] !== undefined
        ? String(row[id].toLowerCase()).includes(filter.value.toLowerCase())
        : true);
    }
  }

and then when calling <ReactTable />:

defaultFilterMethod={this.customFilter}

Hope that helps.

This breaks other filters with integer data types

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ocalde picture ocalde  Â·  3Comments

krishna-shenll picture krishna-shenll  Â·  3Comments

Abdul-Hameed001 picture Abdul-Hameed001  Â·  3Comments

kieronsutton00 picture kieronsutton00  Â·  3Comments

mlajszczak picture mlajszczak  Â·  3Comments