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

DecSoft

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.


Todo el mundo puede leer el foro de soporte de DecSoft para aprender del mismo, sin embargo, sólo los clientes de DecSoft pueden abrir nuevos hilos. Compre una o más licencias de productos de DecSoft y obtendrá este y otros beneficios.

Este sitio utiliza "cookies" útiles para almacenar sus preferencias.

Bien. Ocultar esta nota. Obtener más información.