Editor select list with ajax list of values
Editor select list with ajax list of values
benatherton
Posts: 7Questions: 2Answers: 0
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 theselect
field 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
options
parameter, 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