Learning Dojo — 7. dojo.data

1. It’s
reading/writing data,  of course

2.
Members

  a.
Attributes

    i. data store: get data from data source

   ii. data source: some url

  iii. item = row

        identity = id

        label   = the "name" of an item (e.g. "companyName = ‘IBM’ ") 

        attribute/value = column/value

  b.
Operations

        query = where sql operation

       fetch  = get data

        request = sort/limit

3.
4 features

   a. Read

   b. Write

   c. Identity => Random Access by Id

   d. Notification => hook the data with events

A widget example

  

 
    <div dojoType="dojo.data.ItemFileReadStore" 
         url="datasources/genetox.json"
         jsId="genetoxStoreDeclarative"
         />   



<div dojoType="dijit.form.FilteringSelect"
                store="genetoxStoreDeclarative"
                searchAttr="docno"
                labelAttr="substance"
                name="subname"
                query="{ date: '1995*' }"
                />

Leave a Comment

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.