Dojo Data Stores

From Wiki
Jump to navigation Jump to search

Source

Json-based data stores need a source (either file, a web service, or a hash object) with this format:

{ identifier: 'id', items: [
    {id: 1, width: 50, height: 20},
    {id: 2, width: 10, height: 20}
    ]
}

Create a Store

var pantryStore = new dojo.data.ItemFileReadStore({ url: "pantry_items.json" });  // reads entire file into memory
var recipeStore = new dojox.data.JsonRestStore({target:"/recipeStore"});