Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tree not displaying all children when expanding multiple nodes #1207

Open
TWry opened this issue Nov 23, 2015 · 1 comment
Open

Tree not displaying all children when expanding multiple nodes #1207

TWry opened this issue Nov 23, 2015 · 1 comment

Comments

@TWry
Copy link

TWry commented Nov 23, 2015

I need to expand multiple nodes of a tree structure in a dgrid. Those nodes have more than 20 children. When I use the following code, only some of the children of group1 are visible after expansion:

define(['dgrid/OnDemandGrid', 'dgrid/Tree', "dojo/_base/declare", "./Store",
    'dojo/request/xhr', 'put-selector/put', 'dojo/on'],
  function (Grid, Tree, declare, Store, xhr, put, on) {

  var columns = [
    {
      renderExpando: true,
      label: "Group",
      field: "group"
    },
    {
      label: "Name",
      field: "name"
    }
  ];

  var makeGrid = function(data) {
    var url = "/data/data.json";
    var data;
    xhr.get(url, {
        handleAs: "json",
        sync: true
    }).then(function(xhrdata) {
      data = xhrdata;
    });

    var store = new Store({
          data: data,
          idProperty: "id"
    });

    var TreeGrid = declare([Grid, Tree]);
    var grid = new TreeGrid({
      columns: columns,
      collection: store.getRootCollection()
    }, 'dgrid');

    var but = put(document.body, "button", {
      innerHTML: 'expand'
    });

    on(but, 'click', function(){
      grid.expand('group1');
      grid.expand('group2');
    });
  };

  return {
    renderGrid: function(data){
      makeGrid(data);
    }
  };

});

group2, however, is displayed correctly.

Could this be a bug or am I doing something wrong? dgrid version is 0.4.0.

@kfranqueiro
Copy link
Contributor

Firstly, we recently resolved an issue which might have something to do with this, so could you try testing against the current head of the dev-0.4 branch?

If you still experience the issue, would you be able to provide an example of data that helps reproduce the issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants