In this the setting is
{
type: ‘dropdown’,
source: [‘yellow’, ‘red’, ‘orange’, ‘green’, ‘blue’, ‘gray’, ‘black’, ‘white’]
},
My use case requires dropdown values based on values available in another cell.
For eg:
dropdown1: [“year”, “week”, “months”]
dropdown2: should display values selected from a cell which has values from dropdown1. If year is selected in cell1, the cell2 should display list of years.
Thank you. This is a good example of how you set single value for a dependent cell.
Our use case is setting dropdown values for a cell dependent on another cell. Assume cell1 has “state” and cell 2 has “city”. If a user selects a particular state from cell1, the corresponding cities to be available for selection in cell2.
Thanks. I see that by default we have the Owner column with 4 values. And when we make a change to the Year of Production, the Owner cell dropdown values get corresponding ones.
In our case, the user may or may not modify the “Year of Production”. They would directly double click the “Owner” and it has to have values for the relevant “Year of Production”.
Then you can use a similar logic (additionally) on the initialization. Here is an example https://jsfiddle.net/ef0Lyob4/3/ I’m using the addHookOnce to trigger the attachment of source once (if you use the logic from the last demo you are already covered with the changes made by users).
Hi @aleksandra_budnik, I tried using the beforeChange hook as a setting. Also included afterChange hook. And both of them are triggered only after we exit the cell. Can you please check the below sample from codesandbox.
Try double clicking into a cell for Edit. I was expecting the beforeChange hook to get called. But it doesn’t. It gets called only after I move on to another cell. Am I missing something?