View Full Version : UIView/UIOutline extends...
Zakaroonikov
08-06-2007, 08: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
08-07-2007, 01:09 PM
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
08-07-2007, 03:56 PM
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();
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.