View Full Version : UIView/UIOutline extends...
Zakaroonikov
6 Aug 2007, 4:30 PM
Any chance of making these classes extend Ext.util.observable? And perhaps provide some events so we can kick off tasks on render?
RWaters
7 Aug 2007, 9:09 AM
We certainly could have them extend observable and toss in some extra events. What you can do right now is attach events to the actual grid though.
var vw = new Ext.nd.UIView(etc etc)
vw.grid.on('render', function(grid) { do something with grid })
looks like outline doesn't allow you to access the tree... I'll change that for the next version. If you modify the init2 bit in UIOutline and change the local var tree to this.tree then you could access it similarly.
var ol = new Ext.nd.UIOutline(blah blah)
ol.tree.on('load', myHandler())
RWaters
7 Aug 2007, 11:56 AM
Here's a quick fix so you can reference the tree like the above example.
Index: UIOutline.js
===================================================================
--- UIOutline.js (revision 150)
+++ UIOutline.js (working copy)
@@ -45,7 +45,7 @@
var container = (this.container.getEl) ? this.container.getEl() : this.container;
var Tree = Ext.tree;
- var tree = new Tree.TreePanel(container, {
+ this.tree = new Tree.TreePanel(container, {
animate : true,
enableDD : true,
ddGroup: 'TreeDD',
@@ -64,7 +64,7 @@
draggable : false, // disable root node dragging
id : 'domino-folders'
});
- tree.setRootNode(root);
+ this.tree.setRootNode(root);
var curNode = null;
var arNodes = [];
for (var i=0; i<arEntries.length; i++) {
@@ -131,10 +131,10 @@
}
// handle the drop of the doc on the folder
- tree.on('beforenodedrop', this.addToFolder);
+ this.tree.on('beforenodedrop', this.addToFolder);
// render the tree
- tree.render();
+ this.tree.render();
//root.expand(false, /*no anim*/ false);
root.expand();
Powered by vBulletin® Version 4.1.5 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.