2009年8月19日星期三

[fw-mvc] Sorting and Paging in Dojox.DataGrid

Hello !

I am new to Dojo and trying to adopt dojo in Zend Framework 1.9. I did download and copy dojo 1.3.2 and copied in my /js/dojo folder.

The below code works well and populate grid with data.


1) I populoated Dojox.DataGrid using following code but it does not allow to sort when I click on column header. I have given clientSort="true"
2) How to give paging effect in case of many rows returned ?
3) Is rowsPerPage="20" property is to set to number of max rows returned ?

<html>
<head>
<?php     
    Zend_Dojo_View_Helper_Dojo::setUseDeclarative();
    $this->dojo()->setLocalPath("http://localhost:81/dailywork/public/js/dojo/dojo/dojo.js")
    ->addStyleSheetModule("dijit.themes.nihilo")
    ->addStylesheet("http://localhost:81/dailywork/public/js/dojo/dijit/themes/nihilo/nihilo.css" )
    ->addStylesheet("http://localhost:81/dailywork/public/js/dojo/dojox/grid/resources/nihiloGrid.css" );
    echo $this->dojo();
?>
 <script type="text/javascript">
    dojo.require('dojox.data.QueryReadStore');
    dojo.require('dojox.grid.DataGrid');
    dojo.require("dijit.form.Button");   
  </script>
</head> 
<body class="nihilo"> 
<div dojoType="dojox.data.QueryReadStore" jsId="activeStore", url="records"></div>
<table dojoType="dojox.grid.DataGrid"
    jsId="model"
    store="activeStore"
    query="{ prj_code: '*' }"
    rowsPerPage="20"
    clientSort="true"
    style="width: 500px; height: 500px;"
    rowSelector="20px">
    <thead>
        <tr>
            <th width="200px"
                field="prj_code">Project Code</th>
            <th width="250px"
                field="prj_desc">Project desc</th>
        </tr>
    </thead>
</table>
</body>
</html> 


Please help me on this.

Thanks in Advance !

Naimesh Trivedi

 

 

没有评论: