Load select box in my editor popup dynamically from database

Load select box in my editor popup dynamically from database

itxuseritxuser Posts: 18Questions: 5Answers: 0
edited May 2017 in Free community support

I want to load the options in my select box on the editor popup from the database. I do not have any joins in my sql. What is best way to do this. Do not want to hard code the option values. Thanks!

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,214Questions: 1Answers: 10,415 Site admin

    Two options:

    1. If you want the options list to be in the JSON loaded by DataTables, you can use the options parameter as described here.
    2. If you want to define them on the client-side, us the update() method of the select field type to set the options.

    Allan

  • itxuseritxuser Posts: 18Questions: 5Answers: 0

    Do you have an example? I am just not seeing how to do this at the moment...

  • allanallan Posts: 63,214Questions: 1Answers: 10,415 Site admin
    Answer ✓

    Which method do you want to use? Populate from the server, or from the client?

    Allan

  • itxuseritxuser Posts: 18Questions: 5Answers: 0

    nevermind, much easier than I thought. Thanks!

  • itxuseritxuser Posts: 18Questions: 5Answers: 0

    I used the server to populate it. Very easy.

This discussion has been closed.