Giter Club home page Giter Club logo

Comments (7)

rwieruch avatar rwieruch commented on July 30, 2024

Can you create a reproducible example on https://codesandbox.io/ ?

from react-table-library.

hersheykurra avatar hersheykurra commented on July 30, 2024

please go through: https://codesandbox.io/s/bold-sunset-emyb4o?file=/src/DataTable.js

I replicated the exact issue i am facing.

Please change index.js file to the following:
image

Hope you can help!

from react-table-library.

rwieruch avatar rwieruch commented on July 30, 2024

Does this Codesandbox start for you? For me it shows "Installing Dependencies 1/20 (web-vitals)"

from react-table-library.

hersheykurra avatar hersheykurra commented on July 30, 2024

Hi, could you try this?
https://codesandbox.io/s/jolly-goldwasser-h6y4ue?file=/src/App.js

It requires you to install 2 dependencies.
this is my dependencies page:
image

PLEASE do install 2 dependencies and help me out!

from react-table-library.

rwieruch avatar rwieruch commented on July 30, 2024

Thanks. It works. Can you give me a scenario of two filters unselected (since all filters are initially selected) where you don't get the expected output?

from react-table-library.

hersheykurra avatar hersheykurra commented on July 30, 2024

Thanks for the code Robin! I've tried the same today morning but,
The issue i am facing is.. if i select JUST active & mitigated checkboxes, it should return me all the records with this status. But since we are using && between different columns, it requires me to definitely choose one of the options in other columns(Severity, CreationDate and IncidentType)

Could you suggest if there's a way I can get the data displayed with whatever options i choose without having to definitely choose one of the options in each category. (For example, if you uncheck them all and check just active, it should return me all the data with status as active)

from react-table-library.

rwieruch avatar rwieruch commented on July 30, 2024

Sorry for being late here.

The issue is not with the library, but with your booleans. I made the example smaller by removing some of your filters. In the following we have only Incident Types and Status:

Screenshot 2022-06-22 at 13 42 15

The selection shows no results even though you want to show everything, because all Status are selected. The issue is in this code block:

const data = {
    nodes: list.filter(
      (item) =>
        ((filters.includes("ACTIVE") && item.Status === "ACTIVE") ||
          (filters.includes("MITIGATED") && item.Status === "MITIGATED") ||
          (filters.includes("RESOLVED") && item.Status === "RESOLVED")) &&
          ((filters.includes("CRI") && item.IncidentType === "CustomerReported") ||
          (filters.includes("OTHERS") && item.IncidentType === "LiveSite"))
    )
  };

Which should be:

  const data = {
    nodes: list.filter(
      (item) =>
        (filters.includes("ACTIVE") && item.Status === "ACTIVE") ||
        (filters.includes("MITIGATED") && item.Status === "MITIGATED") ||
        (filters.includes("RESOLVED") && item.Status === "RESOLVED") ||
        (filters.includes("CRI") && item.IncidentType === "CustomerReported") ||
        (filters.includes("OTHERS") && item.IncidentType === "LiveSite")
    )
  };

Try it yourself: https://codesandbox.io/s/billowing-wildflower-2gjj35?file=/src/App.js:981-1416

from react-table-library.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.