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 function HowTO

See original GitHub issue

I’m submitting a … (check one with “x”)

[ ] bug report => search github for a similar issue or PR before submitting
[x ] feature request
[ ] support request => Please do not submit support request here, post on Stackoverflow or Gitter

I want to know, how to make a global search. In the example, is only for single column.

Can you give me a example for a global filter?

Thank you! Current behavior

Expected behavior

Reproduction of the problem

What is the motivation / use case for changing the behavior?

Please tell us about your environment:

  • Table version: 0.8.x
  • Angular version: 2.0.x
  • Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]
  • Language: [all | TypeScript X.X | ES6/7 | ES5]

Issue Analytics

  • State:open
  • Created 6 years ago
  • Comments:7

github_iconTop GitHub Comments

1reaction
stas-khcommented, Feb 26, 2018

I am also interested in such change

0reactions
Sachin124commented, Oct 18, 2018

100 % working for anyone Before doing import the

import { DatatableComponent } from '@swimlane/ngx-datatable';
ViewChild(DatatableComponent) table: DatatableComponent;

// Typescript

   updateFilter(event) {
    const val = event.target.value.toLowerCase();
    var returnData: any;
    // filter our data
    const temp = this.temp.filter(function (d) {

      if (d.yourFirstColumnName.toLowerCase().indexOf(val) !== -1 || !val) {
        returnData = d.user_name.toLowerCase().indexOf(val) !== -1 || !val;
      } else if (d.yourSecondColumnName.toLowerCase().indexOf(val) !== -1 || !val) {
        returnData = d.notes_title.toLowerCase().indexOf(val) !== -1 || !val;

      }
      return returnData;
    });

// HTML

 <input placeholder="Search Order" (keyup)='updateFilter($event)'>
Read more comments on GitHub >

github_iconTop Results From Across the Web

Global Filtering/Search Feature Guide - Material React Table
Material React Table has a powerful built-in global filtering (search) feature that uses a fuzzy matching algorithm and ranks/sorts the results based on...
Read more >
Global Filtering and Sorting with React Table | by Nafeu Nasir
Adding a Global Filter Component. First we want to import some additional hooks from the react-table library, namely the useGlobalFilter ...
Read more >
FILTER function - Microsoft Support
The FILTER function filters an array based on a Boolean (True/False) array. ... Notes: An array can be thought of as a row...
Read more >
how to do custom global filtering on the react table
you would read the value from your input in your filter function. In there you decide what should be in the table. When...
Read more >
API Reference: useGlobalFilter | React Table - TanStack
An instance-level function used to update the global filter value. Example. Source · Open in CodeSandbox · ← PrevuseFiltersNext →useSortBy.
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