dropdown or select control



Ryan Sytsma
I have studied the documentation of both the Dropdown and Select control. It looks like I can only populate the items with a simple array.

If I need to have an array with a key / value, how do I bind that array to these controls? For example:

I would like to set user_id to a variable when the user_name value is selected. How is this possible? Ryan

David Esperalta

Hello Ryan,

The controls that we have "out of the box" don't support something like that. We can know the "index" and the text of the selected item, so we must do whatever thing with that information. Probably it's possible to create something like that using the HTML Control and the appropriate HTML markup and Javascript code, in a similar way than what is show in this post.

If you want to use the "out of the box" controls, it's up to you what to do, based in the data that you are using. So, once you know the item index or the item text, you can search in certain array or object to match that item and get the rest information about the item that you need.

I am not sure if my explaintaion is very good... so please, go ahead if you have any further question.



Everybody can read the DecSoft support forum for learning purposes, however only DecSoft customers can post new threads. Purchase one or more licenses of some DecSoft products in order to give this and other benefits.