tags:

views:

1412

answers:

4

Below is a javascript variable that I'm using to load into the layout-browser...you will notice the listener section is commented out...when I uncomment this section the layout-browser and the tree do not show up. When I comment out the listener section, the layout-browser and the tree work fine with the exception of the listener populating the pool-details-panel.

Any ideas why the listener is blowing the render of the layout-browser and tree up?

var PoolStackTree = {
  id: 'PoolStackTree-panel',
  title: 'Pool List',
  layout: 'border',
  width: 500,
  height: 500,
  items: [{
    xtype: 'treepanel',
    id: 'pooltree-panel',
    region: 'center',
    margins: '2 2 0 2',
    singleExpand: true,
    animate: true,
    useArrows: true,
    autoScroll: true,
    rootVisible: false,
    root: new Ext.tree.AsyncTreeNode(),
    loader: new Ext.app.PoolLoader({ dataUrl: 'calmonpool_views_xml.cgi' })
/*
    listeners { 'render': function(tp) {
      tp.getSelectionModel().on('selectionchange', function(tree-pool, node-pool) {
        var el = Ext.getCmp('pool-details-panel').body;
        if(node-pool && node-pool.leaf) {
          tpl.overwrite(el, node-pool.attributes);
        } else {
          el.update(detailsText);
        }
      })
    }}
*/
  },{
    id: 'pool-details-panel',
    title: 'Pool Details',
    region: 'south',
    autoScroll: true,
    collapsible: true,
    split: true,
    margins: '0 2 2 2',
    cmargins: '2 2 2 2',
    height: 220,
    html: detailsText
  }]
};
A: 

You're missing a comma before the "listeners" property name and a colon after the property name:

...,
listeners: { ...
Ates Goral
A: 

Well just for starters you're missing a ":" after "listeners". That would certainly cause the Tree not to render.

Eric Wendelin
A: 

Is "tpl" defined somewhere?

JW
A: 

Are you using Firebug? Surely aside from "blowing up" you can provide more detail, like the stack trace that the error gives you. Try putting a breakpoint (or a debugger statement) inside your handler function and see what's going on.

bmoeskau