johnhenry
11-18-2003, 05:33 AM
I'm trying to extend the functionality of the TreeView found at this post:
http://www.laszlosystems.com/developers/community/forums/showthread.php?s=&threadid=252&highlight=tree
to include the ability to move folders ondrag and insert new nodes (folders). To enable this, I've been building a custom layout that takes actions on its subviews based on the X and Y coordinates of the rootclass (in this case, the recursive tree class).
The thread above discusses how recursive "clones" are dealt with in a different way than views:
<method event="onclick">
this.toggleVisibility();
</method>
<method name="toggleVisibility">
<![CDATA[
if ( this.smelly ) {
if ( this.smelly.getNodeCount() ) {
// smelly is a LzReplicationManager
for ( var i=0; i < this.smelly.getNodeCount(); i++ ) {
var firstClone = this.smelly.getCloneNumber( i );
firstClone.setVisible( !firstClone.visible );
}
} else {
// smelly is just a view, because there is only one
this.smelly.setVisible( !this.smelly.visible );
}
}
]]>
</method>
So two questions:
1. I'm having problems getting the class and subclasses to be controlled by a single layout. Subclasses should be stacked vertically (along the y axis), but aren't. Does this have something to do with the replication manager clones?
2. The layout (attached in basic form) uses callbacks between subviews and the custom layout to call functions like mouseover. Can't get this functionality working consistently across all views. Is this also related to the way in which the replicationmanager clones nodes?
Any ideas on how to make this work? I think the component would be useful as standard navigation.
-Chris
http://www.laszlosystems.com/developers/community/forums/showthread.php?s=&threadid=252&highlight=tree
to include the ability to move folders ondrag and insert new nodes (folders). To enable this, I've been building a custom layout that takes actions on its subviews based on the X and Y coordinates of the rootclass (in this case, the recursive tree class).
The thread above discusses how recursive "clones" are dealt with in a different way than views:
<method event="onclick">
this.toggleVisibility();
</method>
<method name="toggleVisibility">
<![CDATA[
if ( this.smelly ) {
if ( this.smelly.getNodeCount() ) {
// smelly is a LzReplicationManager
for ( var i=0; i < this.smelly.getNodeCount(); i++ ) {
var firstClone = this.smelly.getCloneNumber( i );
firstClone.setVisible( !firstClone.visible );
}
} else {
// smelly is just a view, because there is only one
this.smelly.setVisible( !this.smelly.visible );
}
}
]]>
</method>
So two questions:
1. I'm having problems getting the class and subclasses to be controlled by a single layout. Subclasses should be stacked vertically (along the y axis), but aren't. Does this have something to do with the replication manager clones?
2. The layout (attached in basic form) uses callbacks between subviews and the custom layout to call functions like mouseover. Can't get this functionality working consistently across all views. Is this also related to the way in which the replicationmanager clones nodes?
Any ideas on how to make this work? I think the component would be useful as standard navigation.
-Chris