dijit/form/DataList

Authors:Doug Hays
Developers:Doug Hays
since:V1.7

DataList is a read-only data store that processes inline OPTION tags as data items. This store implements the new Dojo Object Store API. The DataList store is also a synchronous store. All the functions directly return results, so you don’t have to use asynchronous callbacks in your code.

Examples

HTML5 markup

require(["dojo/parser", "dojo/ready", "dijit/form/DataList", "dijit/registry"], function(parser, ready, DataList, registry){
    ready(function(){
        var store = registry.byId('fruit');
        alert('fruit that start with "B" = ' + store.query({name:/^B.*/}).map(function(option){ return option.name; }));
    });
});
<select data-dojo-type="dijit/form/DataList" id="fruit">
    <option value="Ap">Apples</option>
    <option value="Ba">Bananas</option>
    <option value="Bl">Blueberries</option>
    <option value="Or">Oranges</option>
</select>
../../_images/DataList.png
Error in the documentation? Can’t find what you are looking for? Let us know!