Created
July 18, 2009 02:59
-
-
Save alvin2ye/149386 to your computer and use it in GitHub Desktop.
ext3 ajax tree click
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Ext.onReady(function(){ | |
// shorthand | |
var Tree = Ext.tree; | |
var tree = new Tree.TreePanel({ | |
useArrows: true, | |
preloadChildren :true, | |
autoScroll: true, | |
animate: true, | |
containerScroll: true, | |
border: false, | |
// auto create TreeLoader | |
root: { | |
nodeType: 'async', | |
text: 'Primy 进口', | |
draggable: false, | |
id: 4 | |
}, | |
loader: new Ext.tree.TreeLoader({ | |
dataUrl:'/home/test_tree_text' | |
}) | |
}); | |
tree.render('nav-tree'); | |
tree.getRootNode().expand(); | |
tree.on('click', function(n, e){ | |
var sn = this.selModel.selNode || {}; // selNode is null on initial selection | |
var el = Ext.getCmp('ct-hd') | |
var tb = el.getTopToolbar(); | |
el.setTitle(n.text); | |
tb.addButton({ text: '创建分单', iconCls: 'settings' }); | |
tb.doLayout(); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment