2008年9月29日星期一

Re: [fw-mvc] dijit.Tree

-- Daniel Skinner <skinner@destiny-denied.co.uk> wrote
(on Monday, 29 September 2008, 02:27 PM +0100):
> I would like to create a dijit.Tree element in Zend MVC. What's the best
> way forward? Can Zend_Dojo_View_Helper_Dijit help?

Probably most importantly, you can use Zend_Dojo_Data to provide a
dojo.data store for use with dijit.Tree. This will simplify feeding the
tree with data.

As for the element itself, you have a couple of options. First, you can
use declarative markup within your view scripts:

<?
Zend_Dojo_View_Helper_Dojo::setUseDeclarative(true);
$this->dojo()->requireModule('dijit.Tree');
?>
<div dojoType="dijit.Tree" ...>...</div>

This is the simplest way to achieve this functionality.

Second, and more difficult, you can take a look at
Zend_Dojo_View_Helper_Dijit to see how to extend it to create a
re-usable helper for tree dijits. If you do, please be kind and
contribute back the solution to us, so we can offer it in an upcoming
release of ZF. :)

--
Matthew Weier O'Phinney
Software Architect | matthew@zend.com
Zend Framework | http://framework.zend.com/

没有评论: