Dropdown menu depending of the value of one cell in the row

Hi Handsontable community,

I would like to change the dropdown menu of one cell in my row, depending on the value of another given cell in the same row.
To do this I would like to use some function which are already define in my parent object.

Here is an example on JSFiddle:
https://jsfiddle.net/Lotchi/fq4xwk5c/

Can you please help me? Is it something possible? What is the best solution to do this?

Thanks in advance,
Regards,
Thomas

Hi Thomas,

I have made a similar example where one dropdown list depends on a pick from another one. Here’s the example https://jsfiddle.net/handsoncode/1gtu29rn/
Let me know if you need anything more.

Hi Aleksandra,

I have done some testings and it looks that this can help for sure.
I will apply this to my app and let you know.

Thanks for your quick reply by the way! Much appreciated.

kr
Thomas

Great! I keep my fingers crossed and if you’d need anything just let me know.

Hi Aleksandra,

Actually my case is a bit more complex because I should retrieve my data for an oData service so I have to be able to use function of the parent object in which my HT is declared and initialized.
Actually it means, calling a function from the initial scope. I don’t know if I’m clear enough so you can find a simple example of what I’m trying to do here https://jsfiddle.net/Lotchi/5fnuose9/

myfunction1 is calling myfunction2 which is supposed to be defined outside.

Thanks in advance for your help,
Regards,
Thomas

Sorry here is the appropriate version of the fiddle
https://jsfiddle.net/Lotchi/7ny55bge/

Hi @aleksandra_budnik,

Actually I had to put my object in a table. This table is pass as source data for a dropdown of non existing column in my HTable, that way this initial object is accessible in my closure variables.

So at the end, I found a solution using your tips.

Thanks a lot for your help, this question is now solved.

kr
Thomas

Oh my, I see that you have made a real investigation. I am glad that the problem got solved. I think that we can close the topic.