Dojo Data Stores: Difference between revisions

From Wiki
Jump to navigation Jump to search
Created page with ' == Source == Json-based data stores need a source (either file, a web service, or a hash object) with this format: <pre> { identifier: 'id', items: [ {id: 1, width: 50, hei…'
 
(No difference)

Latest revision as of 22:53, 31 January 2011

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"});