Which is the correct way to change dropdown column source on React

Tags: #<Tag:0x00007f8b243ead58>

Good Day.

I’m facing a problem because I need to change the values that’s appear on my Table when I select a DropDown Cell, but I didn’t found the correct way to change the data before to appear the list of items over the cell.

As you can see in the example, the new values appears when I click two times in the dropdown cell and the desired behavior would be to see immediately the changes over the dropdown.

Software Info

  • Handsontable Pro 7.0.0

  • @handsontable/react 3.0.0

  • React 16.8.3

Example

Live Example

Thanks

Hey @agomezgu

I’m not sure what’s the desired result.

Can you share a draft or input/output data?

As I understand you would like to change the list of values for the dropdown cell type, but when exactly it should happen? (on a button change, server change, etc.)

Hi Aleksandra.

Sure let me just say the steps to reproduce the error :smile: :

  1. You set the initial dropdown options over DropDowns field (Lines 17 and 24)
  2. You click over cell 1 triying to change the value
    3 When you clicked the cell the event afterOnCellMouseDown is fired and the options was changed, but in the screen I can’t see the new options yet (Line 29)
  3. You select a value in the current options but the validator put the cell in red because is not a valid value.
    5 You click again in the cell and the new values appear .

The idea is to change inmediately the new options without to do two clicks

Thank you. I’ll check it out.

Thanks,

On the same way, what happens if I get the new values from a service and I have a delay getting that data :slight_smile:

Have a good day.

I just wanted to ask what exactly you’d like to achieve from and with the afterOnCellMouseDown hook? (where do you use this data in further actions)

I guess that we can close the topic as there’s no reply for nearly 3 weeks.

Please send me an email at support@handsontable.com once to stumble upon any issue.