loop throught controls


Paolo Lops
Hi Davidthere is a metod to loop throuth a view controls to dinamically createa an array of all controls values( inpubox, checkbox datetime etc..)this is usefull to create a dynimic function to store value with some webservice. In javascript there is a funcition like var x = document.getElementsByClassName("example");that i thInk can be usefull.Regards Paolo.

DecSoft

Hello Paolo,

I think we can consider this a more or less "advanced" feature... and, in fact, you already can use "document.getElementsByClassName", or, better, "document.querySelector", or maybe better... an jQuery selector (remember that jQuery is included in our apps by default) and pick classes like "custom-control-input" and "form-control". With these two classes you can match all the inputs controls in your app's view.

Below is a bit of code using jQuery that may you can find of your interest:

If you need any kind of particular help, please, post it here, Paolo.



Paolo Lops

yes...

i'm using thos to build it


Paolo Lops

with jquery is better....

another ask in a select control can we add value and text ?

<select class="mdb-select" disabled> <option value="" disabled selected>Choose your option</option> <option value="paolo1">Option 1</option> <option value="paolo2">Option 2</option> <option value="paolo3">Option 3</option> </select>

DecSoft

Hello Paolo,

If we are talking about an AB Select control, we can add new items using the Select Array "Items". If we are talking about an Select control, but not an AB one, we can add more options to the control in various ways, for example, take a look at this StackOverflow thread.

About the Select value, if we are talking about an AB control, in fact we deal with the selected item index and the item text, to say like that, not exactly the value, and can be retrieved like in the below code:

If we are talking about how to get the value of a Select control which is not an AB control, we can do it in a way like this:

If what we want to get is the Text of the selected value, we can write something like the below code:


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.

This website uses some useful cookies to store your preferences.

I agree. Hide this note. Give me more information.