Vijin Paulraj
Vijin Paulraj

Reputation: 4628

How to get all the values from a FilteringSelect in dojo?

I have a FilteringSelect called select, and the values are being added from different places. At one point of time, I wanted to access all the values from the FilteringSelect.

In order to get a single value, I can use select.get('value'). But I wanted to have all the values in an array. In jQuery, we can do something like below,

var values = $('#select').val();    //returns an array

So, how to do the same in dojo?

Upvotes: 1

Views: 327

Answers (1)

Martin
Martin

Reputation: 71

If you want to get the list of 'options' in the FilteringSelect you can inspect the data element of the store.

e.g.

define([dijit/registry'], function(registry) {
    // this will return an array of options
    registry.byId('select').get('store').data;
});

happy coding.

Upvotes: 2

Related Questions