-- tomascejka <[email protected]> wrote
(on Wednesday, 16 September 2009, 04:38 AM -0700):
> 
> Testing dojo.data.Grid and now I cannot find where I do wrong. If I uncoment
> the row... requireModule("rpc.trainingunit.Unit") alert is showed but dojo
> stop working. 
> If I comment row... grid working. There is a bug?

Is there someting in your rpc.trainingunit.Unit class that causes an
issue? Run that file through jslint (http://www.jslint.com/) and see if
any errors come up. In most of my work with Dojo (and other JS), if the
file does not pass the linter, fixing it so it does corrects any issues.

> Filesystem
> =======
> /dojoroot
>     /dojo
>     /dojox
> /rpc/
>     /trainingunit
>            unit.js
> 
> Content of unit.js for testing is
> alert(11);
> 
> View:
> ===
> <?php
> 
> $this->headTitle("Some title");
> 
> Zend_Dojo_View_Helper_Dojo::setUseProgrammatic();
> 
> //register my modules
> $this->dojo()->registerModulePath("rpc", "../../rpc");
> 
> //init dojo enviroment
> $this->dojo()->addStyleSheet("/dojoroot/dojox/grid/resources/tundraGrid.css")
>            ->addStyleSheet("/dojoroot/dojox/grid/resources/Grid.css")
>            ->requireModule("dojo.data.ItemFileReadStore")
>              ->requireModule("dojox.grid.DataGrid")
>              ->requireModule("dojo.parser")
>              ->requireModule("dojo.rpc.JsonService")
>              ->requireModule("rpc.trainingunit.Unit")
>              ;
> ?>
> <!-- Javascript -->
> <?php $this->headScript()->captureStart() ?>
>     var gridStore = new dojo.data.ItemFileReadStore({
>           data : <?php echo $this->collection ?>
>     });   
> <?php $this->headScript()->captureEnd() ?>
> <?php
> $this->headScript()->appendFile('/js/trainingUnit/trainingUnitGrid.js') ?>
> <div id="gridNode"></div>
> 
> content of trainigUnitGrid.js:
> ==================
> dojo.addOnLoad(function() {
>         /* A simple layout that specifies column headers and
>          * mappings to fields in the store */
>         var gridLayout = [
>                 {name : "ID",    field : "id",    width : "50%"},
>                 {name : "Label", field : "name", width : "50%", sortDesc:
> true }
>         ];
> 
>         /* Programmatically construct a data grid */
>         var grid = new dojox.grid.DataGrid({
>                            store     : gridStore,//gridStore is out of the
> script
>                            structure : gridLayout
>                    }, "gridNode");
>         grid.startup();
>         /* select rows 11-20 inclusive */
>         //dijit.byId("gridNode").selection.selectRange(1,2);
>         //dijit.byId("gridNode").selection.select(2);
>         
>         
>         /* Attach a custom event handler for row selection */
>         dijit.byId("gridNode").selection.onSelected = function(idx) {
>               console.log("onSelected", idx);
>         };       
> });  
> 
> What do I make wrong?
> 
> tomascejka
> 
> -----
> Enviroment
> ==========
> 
> OS:
> SUSE Linux Enterprice 10 (i586) - version 2.6.16.60-0.27-smp
> Windows XP
> 
> Tomcat v6.0.16
> Java(TM) SE Runtime Enviroment (build 1.6.0-b105)
> Java HotSpot(TM) Client VM (build 1.6.0-b105, mixed mode)
> Maven v2.0.9
> Apache 2.2.11
> MySQL 5.1.30
> PHP 5.2.10
> qooxdoo-0.8.2
> Python 2.5
> Zend framework 1.9.2
> Dojo 1.3.2
> 
> Hudson:
> =======
> version 1.304
> plugins: Maven 1.304, SSH Slaves
> running: deployed in Tomcat
> 
> front-end developer web-based application
> A.S.E.I. [http://www.asei.cz]
> -- 
> View this message in context: 
> http://www.nabble.com/Registering-own-dojo-module--stop-working-dojo%2Cdojox-modules-tp25470595p25470595.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
> 

-- 
Matthew Weier O'Phinney
Project Lead            | [email protected]
Zend Framework          | http://framework.zend.com/

Reply via email to