Different editor select list for each row of a datatable
Different editor select list for each row of a datatable

Is it possible to list different items in a select list for a field in an editor window?
If I have a field called "Items", for the first row I only want to allow the user to select any one of "Item 1", "Item 2" or "Item 3".
For "Items" in the second row I only want the user to select from "Item 1" and "Item 2".
The third row would allow the user to select "Item 1", "Item 2", "Item 3" and "Item 4".
This discussion has been closed.
Answers
Interesting question!
Have you tried making up the 'select' with something based on the inline snippet?
Yes this would be possible using the
field().update()
method, which lets you change the options of the select list. You could call then in anopen
event handler, which leaves just the issue of deciding what options you want to show in the select box for the row!Oh I should say to get the row being edited us
table.row( editor.modifier() ).data()
.Allan