PhpRiot
Become Zend Certified

Prepare for the ZCE exam using our quizzes (web or iPad/iPhone). More info...


When you're ready get 7.5% off your exam voucher using voucher CJQNOV23 at the Zend Store

Zend_Dojo_Data: dojo.data Envelopes

Dojo provides data abstractions for data-enabled widgets via its dojo.data component. This component provides the ability to attach a data store, provide some metadata regarding the identity field and optionally a label field, and an API for querying, sorting, and retrieving records and sets of records from the datastore.

dojo.data is often used with XmlHttpRequest to pull dynamic data from the server. The primary mechanism for this is to extend the QueryReadStore to point at a URL and specify the query information. The server side then returns data in the following JSON format:

{
    identifier: '<name>',
    <label: '<label>',>
    items: [
        { name: '...', label: '...', someKey: '...' },
        ...
    ]
}

Zend_Dojo_Data provides a simple interface for building such structures programmatically, interacting with them, and serializing them to an array or JSON.

Zend Framework