Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: c5097267a7
Fetching contributors…

Cannot retrieve contributors at this time

69 lines (66 sloc) 2.357 kb
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
<title>Test JsonRest store</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta name="viewport" content="width=570" />
<style type="text/css">
@import "../../dojo/resources/dojo.css";
@import "../css/skins/claro.css";
h2 {
margin: 12px;
.heading {
font-weight: bold;
padding-bottom: 0.25em;
margin: 10px;
<script type="text/javascript" src="../../dojo/dojo.js"
data-dojo-config="async: true"></script>
<script type="text/javascript">
require(["dgrid/List", "dgrid/OnDemandGrid","dgrid/Selection", "dgrid/Editor", "dgrid/Keyboard", "dgrid/Tree", "dojo/_base/declare", "dojo/store/JsonRest", "dojo/store/Observable", "dojo/store/Cache", "dojo/store/Memory", "dojo/domReady!"],
function(List, Grid, Selection, Editor, Keyboard, Tree, declare, JsonRest, Observable, Cache, Memory){
var testStore = Observable(Cache(JsonRest({
idProperty: "id",
query: function(query, options){
// have to manually adjust the query to get rid of the double ?? that trips php up
query = "parent=" + parent;
return, query, options);
}), Memory()));
testStore.getChildren = function(parent, options){
return testStore.query({parent:}, options);
var columns = [
Tree({label:'Name', field:'name', sortable: false}),
{label:'Id', field:'id', sortable: false},
Editor({label:'Comment', field:'comment', sortable: false}, "text"),
Editor({label:'Boolean', field:'boo', sortable: false, autoSave: true}, "checkbox")
window.grid = new (declare([Grid, Selection, Keyboard]))({
store: testStore,
getBeforePut: false,
columns: columns
}, "grid");
deleteSelected = function(){
for(var i in grid.selection){
<body class="claro">
<h2>A basic grid with JsonRest store</h2>
<div id="grid"></div>
<button onclick='deleteSelected()'>Delete Page</div>
<button onclick=';'>Save</div>
Jump to Line
Something went wrong with that request. Please try again.