Editor select list with ajax list of values
Editor select list with ajax list of values
Hi,
Is it possible to have a select list (https://editor.datatables.net/reference/field/select) within the editor populate with a list of values from an AJAX source?
Does anyone have any example code for this?
Thanks in advance.
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Yes, you can make the Ajax request to get the list of options and then use the
update()method for theselectfield type (e.g.editor.field( 'mySelect' ).update( json );).Alternatively, if the options can be defined when the initial data set is loaded by DataTables, you can include an
optionsparameter, which is used in this example. Documentation for that is available here.Allan
Where does the my select came form?
That's the name of the field you want to change. See the
field()documentation for details.Allan