Return extra data besides tree data from ExtJS TreeLoader dataUrl?

Posted by Chad Johnson on Stack Overflow See other posts from Stack Overflow or by Chad Johnson
Published on 2010-06-05T19:46:35Z Indexed on 2010/06/05 19:52 UTC
Read the original article Hit count: 635

Filed under:

I asked this question in the Ext JS forums, but I received no responses, so I am asking here.

I have a TreePanel (code below) that uses a TreeLoader and an AsyncTreeNode. In my API method specified by the TreeLoader's dataUrl, I return a JSON array to populate the tree.

This works great, of course. However, I need to return an additional item--an integer--in addition to the array, and I need to display that value somewhere else in my UI. Is this possible? If not, what else would be a good solution?

Here's the code I have currently:

tree = new Ext.tree.TreePanel({
  enableDD: true,
  rootVisible: false,
  useArrows: true,

  loader: new Ext.tree.TreeLoader({
    dataUrl: '/api/method'
  }),

  root: new Ext.tree.AsyncTreeNode()
});

© Stack Overflow or respective owner

Related posts about extjs