Dynamic Editor Select type values

Dynamic Editor Select type values

sogormansogorman Posts: 1Questions: 1Answers: 0

Hello! Looking through the API docs I am unable to figure out how to change the available options for a select field. What I need to have happen is when an editor is actioned I will make an ajax call to determine which select values should be allowed based upon some other record value then I need to update the editor with the available options.

Answers

  • allanallan Posts: 61,860Questions: 1Answers: 10,135 Site admin

    Hi,

    To change the options, you would use the update() field method of the select() type. For example: editor.field( 'myField' ).update( ...options... );.

    What I need to have happen is when an editor is actioned I will make an ajax call to determine which select values should be allowed based upon some other record value

    You might want to take a look at the dependent() method which can help reduce the boilerplate code for that kind of thing.

    Allan

This discussion has been closed.