Zend framework with dojo

kssvtm1925

New Member
I'm developing an application with zend framework and i'd like to add dojo framework.I've done the following :Bootstrap.php : \[code\]public function _initViewHelpers() { $this->bootstrap('layout'); $layout = $this->getResource('layout'); $view = $layout->getView(); $view->addHelperPath('Zend/Dojo/View/Helper', 'Zend_Dojo_View_Helper'); $view->dojo()->enable(); } \[/code\]my layout.phtml\[code\]<?php echo $this->doctype() ?><html> <head> <?php echo $this->headTitle() ?> <?php echo $this->headMeta() ?> <?php echo $this->headLink() ?> <?php echo $this->headStyle() ?> <?php if ($this->dojo()->isEnabled()){ $this->dojo()->setLocalPath('/js/dojo/dojo.js') ->addStyleSheetModule('dijit.themes.claro'); echo $this->dojo(); } ?> <?php echo $this->headScript() ?></head><body class="claro"> <?php echo $this->layout()->content ?> <?php echo $this->inlineScript() ?></body>\[/code\]finally my index.phtml : \[code\]<script type="text/javascript">dojo.addOnLoad(function() { // our test data store for this example: var store4 = new dojo.store.JsonRest({ target: '/guestbook/test' }); storeData = http://stackoverflow.com/questions/7907229/new dojo.data.ItemFileReadStore( { data:store4 } ); // set the layout structure: var layout4 = [{ field:'Title', name: 'Title of Movie', width: '200px' }, { field: 'Year', name: 'Year', width: '50px' }, { field: 'Producer', name: 'Producer', width: 'auto' }]; // create a new grid: var grid4 = new dojox.grid.DataGrid({ query: { Title: '*' }, store: storeData, clientSort: true, rowSelector: '20px', structure: layout4 }, document.createElement('div')); // append the new grid to the div "gridContainer4": dojo.byId("gridContainer4").appendChild(grid4.domNode); // Call startup, in order to render the grid: grid4.startup();});\[/code\]\[code\]<div id="gridContainer4" style="width: 100%; height: 100%;"></div><?php // setup required dojo elements:$this->dojo()->enable() ->setDjConfigOption('parseOnLoad', true) ->requireModule('dojo.store.JsonRest') ->requireModule('dojo.data.ObjectStore') ->requireModule('dojo.data.ItemFileReadStore') ->requireModule('dojox.data.QueryReadStore') ->requireModule('dojox.grid.DataGrid') ->addStyleSheet('/js/dojox/grid/resources/claroGrid.css') ->addStyleSheet('/js/dojox/grid/resources/Grid.css'); ?>\[/code\]when i'm trying to access the page localhost/guestbook, the page is rendered but no datagrid, it's like javascript is not enabled...the url /guestbook/test return a json object.And in firebug, there is no javascript error, the dojo.js is loaded, the dojo modules and the css too.I don't understand what is happening !Thanks :)
 
Top