Populate dijit multiselect

2641
3
02-29-2016 08:40 PM
SadanandacharB1
New Contributor III

Hi All,

          I have a small problem with storing multiselect in dojo, I have a combobox and i am filling that with json values. But i am having a problem with populating multiselect, Please help me.

I am using web api odata service to get values from the database and populating them into dojo multiselect.

Tags (1)
0 Kudos
3 Replies
MiriamBrockmann
Occasional Contributor

Please add some code to your Post, this could be helpful for us to help you. And where exactly is the Problem? What does it or what not? Any Errors?

Regards

SadanandacharB1
New Contributor III

Hi Miriam Brockmann,

                     I am populating the combobox with jason values as below using web api odata service,

              this._roadClass = new comboBox({

                    labelAttr: "queryType",

                    labelType: 'text',

                    placeHolder: "Select Boundary",

                    searchAttr: "queryType",

                    autoWidth: true,

                    onChange: lang.hitch(this, this._onroadClassSelected)

                }, this.roadClassNode);

In the same way i am populating the dijit/Multiselect, but i am not getting, what is wrong here?

0 Kudos
MiriamBrockmann
Occasional Contributor

Hi Sandanandachar!

I've doing a little research about populating a dijit.form MultiSelect and find this Post:

multiselect widget not populating

With a ComboBox you can use a store to fill up, but that won't work when you use a

MultiSelect. It's like a <SELECT> - Element, that must be filled with <OPTION> - nodes.

So you have to do with yours. In the Link mentioned above, there are two good Examples how to do that.

Here's the Link to the documentation :

dijit.form.MultiSelect — The Dojo Toolkit - Reference Guide

Hope this might help you!

Regards, Miriam

0 Kudos