Dynamically change the Editor 'select' options as per another 'select' value
Dynamically change the Editor 'select' options as per another 'select' value

I'm using the Editor to edit table in which have 2 fields in the type of 'select', now I'd like to change one cell's options as per another cell's changed data, for example:
Cell-1 have options ['a', 'b'], change its value from 'a' to 'b', Cell-2 options are changed from ['a-1', 'a-2'] to ['b-1', 'b-2'].
How can i do that?
Thanks...
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Cascading lists example:
https://datatables.net/blog/2017-09-01
Thank you tangerine.
I add a line of code in JS after the editor created:
editor.dependent('system', '/api/subsystem')
and define a <post> interface to get the response:
{
"options": {
"system" [
{ "label": XXX, "name": XXX},
......
{ "label": XXXX, "name": XXXX},
]
}
}
But while I tried to edit the table, here comes a new problem, the <post> request are triggered constantly, and subsystem field kept blinking, I have to stop the backend server.
What do I miss on the usage of API dependent()?
Thanks.
Sorry, I made a mistake, In my code I gave the wrong value for the first argument of editor.dependent('system', '/api/subsystem').
Problem solved, thanks!