GithubHelp home page GithubHelp logo

Dropdown is not working about reactgrid HOT 5 CLOSED

silevis avatar silevis commented on May 22, 2024
Dropdown is not working

from reactgrid.

Comments (5)

czerwiukk avatar czerwiukk commented on May 22, 2024 1

Hi guys! Thank you for reporting this issue.
In the current implementation of the Dropdown Cell, the user has to keep the state of the dropdown on his own.
The cell expects to receive isOpen property within the cell, like this:

{
  type: "dropdown",
  selectedValue: person.name,
  inputValue: person.name,
  isOpen: true /* or false */,
  values: getPeople().map((p) => ({ label: p.name, value: p.name }))
},

I can see that it's not described in the docs, so thank you again for pointing this out.
If this behavior doesn't meet your needs, you can always create and use your own dropdown cell.

from reactgrid.

hunterwilhelm avatar hunterwilhelm commented on May 22, 2024 1

@czerwiukk Thank you! For those that need an example of what the suggestion is, here is my sandbox.

Look for the comments that say // CHANGED: because those lines are the important parts

https://codesandbox.io/s/silevis-reactgrid-working-dropdown-example-ow9j2c?file=/src/App.tsx

from reactgrid.

hunterwilhelm avatar hunterwilhelm commented on May 22, 2024

I am having this problem too.

Here is a sandbox that shows the issue

https://codesandbox.io/s/jolly-galileo-jivsd2?file=/src/App.tsx

from reactgrid.

hunterwilhelm avatar hunterwilhelm commented on May 22, 2024

Here is another example that doesn't modify the person interace. Instead, we hold a dropbox opened location state with useState and set it when something opens.

https://codesandbox.io/s/silevis-reactgrid-better-generic-dropdown-ue7wph?file=/src/App.tsx

from reactgrid.

karan316 avatar karan316 commented on May 22, 2024

Why is this not a part of the default behaviour of the DropdownCell?

from reactgrid.

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.