Welcome, guest ( Login )

WikiHome » DojoDataUseCases » Binding Select to Data

Binding Select to Data

Version 4, changed by chrism 02/26/2007.   Show version history

Summary:

Linking the selectable items in a Select widget to items in a datastore.

Programmatic:

var stateData = [{ abbreviation: "CA", name: "California"}, ... ];
var store = new JsonItemStore({ data: stateData});

var resultObject = store.find({
    query: {stateName: "c.*"},
    onnext: myCallbackFunction
});

function myCallbackFunction(){
    dojo.lang.forEach(resultObject.items, function(item){
         dojo.debug("abbrev is " + store.getValue(item, "abbreviation"));
         dojo.debug("name is " + store.getValue(item, "name"));
    });
}

Declarative:




Discussion:







Attachments (0)

  File By Size Attached Ver.