Open vijilaks opened 10 years ago
When I expand a node in the tree of a grid, the ajax call is made to get the children but does not display children. Not sure, where I'm going wrong. Any help is greatly appreciated. Thanks. Here is the code snippet:
require(["dgrid/List", "dgrid/OnDemandGrid","dgrid/Selection", "dgrid/editor", "dgrid/Keyboard", "dgrid/Selection", "dgrid/tree", "dgrid/extensions/DnD", "dojo/_base/declare", "dojo/store/JsonRest", "dojox/json/ref", "dojo/store/Observable", "dojo/store/Cache", "dojo/store/Memory", "dojo/domReady!"], function(List, Grid, Selection, editor, Keyboard, Selection, tree, DnD, declare, JsonRest, jsonRef, Observable, Cache, Memory){
var DnDList = declare([List, Keyboard, Selection, DnD]), DnDGrid = declare([Grid, Keyboard, Selection, DnD]); //dojox.json.ref.refAttribute = "uuid"; var rootUuid = "ee9ac5d2-a07c-3981-a57a-f7f26baf38d8"; var testStore = Cache(JsonRest({ //Observable(Cache(JsonRest({ target:"/uuid/", idProperty: "uuid", query: function(query, options){ query = rootUuid+"/dojoTreeRoot"; options=""; return JsonRest.prototype.query.call(this, query, options); }, getChildren : function(parent, options){ return testStore.get(parent.uuid).children; } }), Memory()); var columns = [ tree({label:'Name', field:'displayName', sortable: false}) ]; window.grid = new DnDGrid({ //new (declare([Grid, Selection, Keyboard]))({ //sort: "id", store: testStore, selectionMode: "single", loadingMessage: "Loading data...", //noDataMessage: "No results found.", //getBeforePut: false, columns: columns, dndParams: { allowNested: true, // also pick up indirect children w/ dojoDndItem class checkAcceptance: function(source, nodes) { return source !== this; // Don't self-accept. } } }, "grid");
});
When I expand a node in the tree of a grid, the ajax call is made to get the children but does not display children. Not sure, where I'm going wrong. Any help is greatly appreciated. Thanks. Here is the code snippet:
require(["dgrid/List", "dgrid/OnDemandGrid","dgrid/Selection", "dgrid/editor", "dgrid/Keyboard", "dgrid/Selection", "dgrid/tree", "dgrid/extensions/DnD", "dojo/_base/declare", "dojo/store/JsonRest", "dojox/json/ref", "dojo/store/Observable", "dojo/store/Cache", "dojo/store/Memory", "dojo/domReady!"], function(List, Grid, Selection, editor, Keyboard, Selection, tree, DnD, declare, JsonRest, jsonRef, Observable, Cache, Memory){
});
A basic grid with JsonRest store