2 * Ext JS Library 0.30
\r
3 * Copyright(c) 2006-2009, Ext JS, LLC.
\r
4 * licensing@extjs.com
\r
6 * http://extjs.com/license
\r
9 // Implementation class for created the tree powered form field
\r
10 ListSelector = Ext.extend(Ext.ux.TreeSelector, {
\r
12 listenForLoad: false,
\r
13 initComponent : function(){
\r
15 this.tree = new Ext.tree.TreePanel({
\r
18 width: this.treeWidth || 180,
\r
21 selModel: new Ext.tree.ActivationModel(),
\r
22 loader : new ListLoader({store: this.store})
\r
25 var root = new Ext.tree.AsyncTreeNode({
\r
29 iconCls: 'icon-folder',
\r
33 this.tree.setRootNode(root);
\r
35 this.tree.on('render', function(){
\r
36 this.store.bindTree(this.tree);
\r
39 ListSelector.superclass.initComponent.call(this);
\r
41 // selecting folders is not allowed, so filter them
\r
42 this.tree.getSelectionModel().on('beforeselect', this.beforeSelection, this);
\r
44 // if being rendered before the store is loaded, reload when it is loaded
\r
45 if(this.listenForLoad) {
\r
46 this.store.on('load', function(){
\r
54 beforeSelection : function(tree, node){
\r
55 if(node && node.attributes.isFolder){
\r