field().update()
Update the options available for list field types.
Please note - this property requires the Editor extension for DataTables.
The full Editor reference documentation is available to registered users of Editor - the information shown below is a summary only. If you already have an Editor license please sign-in, alternatively an Editor license can be purchased on this site, or sign up for the free trial.
Description
Important: This method is only available on fields which provide a list of options to the end user! The built in field types with this ability are:
Plug-ins such as that for Select2 may also provide this method, please check their documentation for full details and all methods available for each. If this method is called on any other field types (e.g. text
) an error will be thrown as the function will not exist.
This method is used to dynamically update the list of options that the user can select from. It can be used to fully replace the existing list of options, or optionally to append new options to the existing list. Note that the order is determined by the array passed in - the field types don't attempt to sort the options.