How to Fill select field from Ajax

How to Fill select field from Ajax

VAILLY OlivierVAILLY Olivier Posts: 19Questions: 0Answers: 0

Hi guys,

is there a way to fill a select field with the return of an Ajax query ?

this link : https://editor.datatables.net/reference/field/select
only discribe static initialisation ......

Thanks
Oliver

Replies

  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin

    Absolutely - there is an update method described on the page you linked to. You might use:

    editor.field( 'mySelect' ).update( newOptions );
    

    Allan

  • VAILLY OlivierVAILLY Olivier Posts: 19Questions: 0Answers: 0

    Thanks Allan "always on top" :)

    So i just have to construct a variable as a ajax/php/sql query result and pass it to update ?
    if so cool ...

  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin

    Absolutely - that update array / object and come from wherever you want.

    Allan

  • VAILLY OlivierVAILLY Olivier Posts: 19Questions: 0Answers: 0

    Thanks Allan !

This discussion has been closed.