Suchith
Suchith

Reputation: 37

Filling dojo combobox with json data

I have a json object retrieved from a method which contains user information. I want to set that json object as a store of a dojo combobox. Please help.

Upvotes: 0

Views: 433

Answers (1)

Dimitri Mestdagh
Dimitri Mestdagh

Reputation: 44685

So if I understand correctly, you want to use a single object as the store of a combobox (so it would only give 1 option?). If you're trying to use an array of JSON objects as a JSON store, I suggest looking at enter link description here.

As you can see they have a store with inside the data attribute an array of JSON objects.

new Memory({
    data: [
       ...
    ]
});

Then they create a ComboBox and the most important things are the store and the searchAttr properties. With the store property you can connect your store to the combobox and with the searchAttr property you can say which property of your JSON object is the visible thing that should be displayed in your combobox.

Upvotes: 1

Related Questions