Hi Guy’s
is it possible to append/change items from a selectbox at runtime?
I do have a dhtmlxform with a selectbox (combobox). Usually its element, item are defined by xml or a divblock in html, like this:
<ul class="dhtmlxForm">
<li ftype="select" name="xyz">Text
<ul>
<li ftype="option" value="1">1</li>
<li ftype="option" value="2">2</li>
</ul>
</li>
</ul>
Now I need the ability to change/add the items of this selectbox with values form database at runtime.
Andrei
August 30, 2010, 2:42pm
#2
Hello,
please check
docs.dhtmlx.com/doku.php?id=dhtm … getoptions
select item’s options collection is returned.
I don’t need a function which returns me values. I need an option to set values at runtime.
Andrei
August 30, 2010, 2:53pm
#4
What moment do you mean under runtime?
before init/after init/something else?
Sorry, i am a dot.net developer, fresh in cloud-computing. With runtime I mean after initialisation of the form. I need to be able to change the Select-Box values when ever I want.
Andrei
August 30, 2010, 3:48pm
#6
Codeline below will return select’s options collection:
var opts = form.getOptions(name);
Where “name” is your select’s name used in form init object (or from what do you init form).
Then you may proceed with it like with usual select’s options, for example:
opts.add(new Option("Option Text", "Option Value"));
Something like.
Hi again,
that is not the right way. Because I don’t use dhtmlxCombo! I use the dhtmlxForm with integrated Combo, which is not dhtmlxCombo!!! Is there a way to do it with the dhtmlxForm-Combo or can I integrate dhtmlxCombo in dhtmlxForm?
Andrei
September 13, 2010, 11:53am
#8
Hello.
Suggested solution is for default combo, used in form.
For the moment dhtmlxCombo is not supported directly by the form.