| | 1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" |
| | 2 | "http://www.w3.org/TR/html4/strict.dtd"> |
| | 3 | <html> |
| | 4 | <head> |
| | 5 | <style type="text/css"> |
| | 6 | @import "../../../dojo/resources/dojo.css"; |
| | 7 | @import "../../../dijit/themes/tundra/tundra.css"; |
| | 8 | @import "../../../dijit/themes/tundra/tundra_rtl.css"; |
| | 9 | @import "../../grid/_grid/tundraGrid.css"; |
| | 10 | @import "../../../dijit/tests/css/dijitTests.css"; |
| | 11 | </style> |
| | 12 | |
| | 13 | <title>Query read store test with grid and serverside sorting/paging</title> |
| | 14 | |
| | 15 | <script type="text/javascript" src="../../../dojo/dojo.js" djConfig="isDebug: true, parseOnLoad: true"></script> |
| | 16 | <script type="text/javascript"> |
| | 17 | dojo.require("dojox.data.QueryReadStore"); |
| | 18 | dojo.require("dojox.grid.Grid"); |
| | 19 | dojo.require("dojo.parser"); |
| | 20 | </script> |
| | 21 | <script type="text/javascript"> |
| | 22 | var layoutStates = [ |
| | 23 | { cells: [[ |
| | 24 | { field: "label", name: "Label", width: '20' }, |
| | 25 | { field: "abbreviation", name: "Abbreviation", width: 20 } |
| | 26 | ]]} |
| | 27 | ]; |
| | 28 | </script> |
| | 29 | </head> |
| | 30 | <body class="tundra"> |
| | 31 | <p> |
| | 32 | This simple demo shows the use of QueryReadStore talking to a simple PHP server script that can handle |
| | 33 | serverside paging and sorting. This demonstrates that virtual scrolling and sorting can work properly |
| | 34 | with server based data stores. |
| | 35 | </p> |
| | 36 | |
| | 37 | <!-- Construct QueryReadStore impl that defines that the server should do all sorting and paging |
| | 38 | The reasonable way to handle grid. |
| | 39 | --> |
| | 40 | <div dojoType="dojox.data.QueryReadStore" |
| | 41 | jsId="queryStore" |
| | 42 | url="stores/QueryReadStore.php" |
| | 43 | requestMethod="get" |
| | 44 | doClientPaging="false" |
| | 45 | doClientSorting="false"></div> |
| | 46 | |
| | 47 | <div dojoType="dojox.grid.data.DojoData" |
| | 48 | jsId="queryModel" |
| | 49 | store="queryStore" |
| | 50 | query="{label: '*'}" |
| | 51 | sortFields="[{attribute: 'name', descending: true}]" |
| | 52 | rowsPerPage="5"> |
| | 53 | </div> |
| | 54 | <div dojoType="dojox.grid.Grid" |
| | 55 | style="width: 500px; height: 200px;" |
| | 56 | model="queryModel", |
| | 57 | structure="layoutStates"></div> |
| | 58 | </body> |
| | 59 | </html> |