0

i have created a new dgrid with a selector and tree column. I can get my data populated and the grid working properly, with the exception of the indent on childNodes in the tree column. I have created my tree as follows :

var treeGrid = new (declare([OnDemandGrid, Selection]))({
            store:this.store,
            id: this.id + ".tree",
            selectionMode: "none",
            loadingMessage: "Loading...",
            noDataMessage : "No results found.",
            showHeader :false,
            columns : [
                       selector({className:"tocCheckboxColumn"}),
                       tree({field:"displayName", sortable:false, indentWidth:20})
                       ]
        },this.domNode);

My thinking is that I should be able to set indentWidth property as part of the column itself but it doesn't seem to working and all my children render directly below the parent without any indentation. Any ideas? Thanks!

Burglins
  • 1
  • 1

1 Answers1

0

So the problem was with my getChildren method of my store. In order to get my indentWidth to register I added a call before returning my queryResults to store.put for the object whose children I was adding after making changes to it in getChildren().

var children = [];
array.forEach(infos, lang.hitch(this, function(info) {
    var child = {                                                
 ...
 };
    children.push(child);
    this.store.add(child);
    }));
    def.resolve(children);
    object.fetchedChildren = true;
    this.store.put(object);
    return new dojo.store.util.QueryResults(def.promise);   
Burglins
  • 1
  • 1