Skip to end of metadata
Go to start of metadata

<ac:macro ac:name="unmigrated-inline-wiki-markup"><ac:plain-text-body><![CDATA[

<ac:macro ac:name="unmigrated-inline-wiki-markup"><ac:plain-text-body><![CDATA[

Zend Framework: Zend_Dojo - dojox.grid.DataGrid Support Component Proposal

Proposed Component Name Zend_Dojo - dojox.grid.DataGrid Support
Developer Notes - dojox.grid.DataGrid Support
Proposers Matthew Weier O'Phinney
Zend Liaison TBD
Revision 1.0 - 15 January 2009: Initial Draft. (wiki revision: 4)

Table of Contents

1. Overview

dojox.grid.DataGrid provides a powerful abstraction for presenting dynamic, infinitely scrolling grids of data that are backed by server-side data stores. While it is relatively easy to create these either programmatically or declaratively, ZF developers could benefit from having a PHP OOP interface for generating the necessary markup or Javascript. This proposal introduces a view helper to solve this task.

In addition to supporting dojox.grid.DataGrid, this proposal will add support for generating client-side objects using declarative or programmatic syntax via a view helper. (For creating the actual data consumed by objects, Zend_Dojo_Data will still be used.)

2. References

3. Component Requirements, Constraints, and Acceptance Criteria

  • The DataGrid view helper will support both declarative and programmatic generation
  • The DataGrid view helper could support multi-row items (optional requirement)
  • The DataGrid view helper will load the required stylesheets to ensure display
    • Loading of stylesheets should be switchable (in the case that they are loaded in a user-defined theme, for example)
  • The DataGrid view helper will allow capturing <script> content for use with the grid
  • The DataGrid view helper will allow specifying each field and all options related to each field
  • the DataGrid view helper must allow programmatically specifying all grid options, as well as passing them during configuration.
  • The DataStore view helper must require minimally a jsId and dojoType in order to work
  • The DataStore view helper will use all options aside from the jsId and dojoType in order to configure the data store
  • The DataStore view helper will support both declarative and programmatic generation

4. Dependencies on Other Framework Components

  • Zend_Dojo_View_Helper_Dojo
  • Zend_Dojo_View_Helper_Dijit

5. Theory of Operation

The developer will use the dojox.grid and store view helpers as they would normal view helpers: passing an identifier, any other required options, and then an optional array of additional parameters used to configure the helper. However, each will return a unique object instead of a string that may then be further manipulated.

As an example, the following generates a grid object, and then configures it:

The object returned will implement __toString(), which will allow it to be echoed directly:

The object will receive an instance of the view object, which will allow it ot interact with the dojo() and dijit() view helpers in order to setup appropriate dojo.require statements, dojo.addOnLoad events, etc.

6. Milestones / Tasks

  • Milestone 1: Initial proposal written
  • Milestone 2: Working prototype of dataStore() view helper checked into incubator (with tests)
  • Milestone 3: Working prototype of dataGrid() view helper checked into incubator (with tests)
  • Milestone 4: Full documentation completed

7. Class Index

  • Zend_Dojo_View_Helper_DataStore
  • Zend_Dojo_View_Helper_DataStore_Instance
  • Zend_Dojo_View_Helper_DataGrid
  • Zend_Dojo_View_Helper_DataGrid_Instance

8. Use Cases


Programmatic store creation


Passing options during store creation


Programmatic configuration of a grid object


Configuration of data grid at creation

9. Class Skeletons




Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.
  1. Apr 27, 2009

    <p>Something like this would be great. The more Dojo stuff that can be abstracted out into ZF the better; the Dojo docs are far less complete or usable than the ZF ones so a better-documented interface them would be fabulous. Same for dijit.Tree.</p>

  2. May 19, 2009

    <p>Sry not "My" <ac:emoticon ac:name="laugh" /> but - Hi Matthew,</p>

    <p>do you have any plan for this ? or do you work on this component ?</p>

    <p>Would be great if ZF would support dojox.grid.dataGrid and the source code above is exactly what many peoples lacking in ZF.</p>

    <p>Can you post some info if you are working on this ?</p>

    <p>Thank you</p>

  3. Oct 14, 2009

    <p>Is this proposal moving forward at all?</p>

    <p>If there is any working (or not-working) code to start from that would be nice. We would probably like to work on this or put one of our contractors on it, as we desperately need something like this.</p>

  4. Mar 11, 2010

    <p>I went ahead and wrote up view helpers to match this proposal. My hope is that Matthew can approve them or hand this proposal over to someone else. These helpers are extremely useful and I feel they should be included in the Zend Framework as soon as possible.</p>

    <p><a class="external-link" href=""></a></p>

  5. Apr 16, 2010

    <p>Nice work Kyle. I am going to take your code for a spin. Would love to see something like this officially become part of the Zend Framework.</p>