I am looking on how I would go about extending TreeNode to include new config options. I currently have a TreePanel that uses a TreeLoader to generate TreeNodes. I am confused how I would accomplish this because TreeLoader calls TreeNode directly and I do not. AbstractDocument.AbstractElement:: Adds a set of attributes to the element. abstract Enumeration < TreeNode. children Gets the attributes for the element. TreeNode. getChildAt (int childIndex) http://java.sun.com/j2se/1.5.0/jcp/beta2/apidiffs/javax/swing/texment.AbstractElement.htmlHOME |
This is currently how the TreeNode is generated...
TEXT
and I need to add extra attributes to the anchor that is created by TreeNode to make it look like so...
TEXT
I have looked at the Ext.etend tuts but I am still a little confused since I do not call TreeNode directly. is there a way to add tootip options besides text for treenodes :: [Archive] is there a way to add tootip options besides text for treenodes? working when not initialized using the qtip config attribute of the treenode. http://extjs.com/forum/archive/index.php/t-5637.htmlHOME | AbstractDocument.AbstractElement (Java Platform SE 6):: AttributeSet, Element, MutableAttributeSet, TreeNode. Direct Known Subclasses: Gets the attributes for the element. TreeNode. getChildAt(int childIndex) http://java.sun.com/javase/6/docs/api/javax/swing/text/AbstractDocument.AbstractElement.htmlHOME |
Any help would be appreciated.
Thanks,
Eric
Ext.override(Ext.tree.TreeNodeUI, {
renderElements: function(n, a, targetNode, bulkRender){
//modified code
}
});
I was able to override the renderElements function instead as I was already passing the new attribute in the JSON array.
Thanks. This helped a lot. :D
Ext.override(Ext.tree.TreeNodeUI, {
renderElements: function(n, a, targetNode, bulkRender){
//modified code
}
});
I was able to override the renderElements function instead as I was already passing the new attribute in the JSON array.
Thanks. This helped a lot. :D
Perfect! To override render was only my first thought... I'm glad it works.
You would probably had better to override method render of TreeNodeUI. The rough sequence would be:
Ext.override(Ext.tree.TreeNodeUI, {
render: function(bulkRender) {
// put original code of render here
}
});
Then you can add your functionality by altering and/or adding to the above render function.
On the road of development you may find that you need to override more methods. But the philosophy is same.
Red Hat's Rough Recovery From CFO Exit
Windows Live Finds a New, Pre-installed Home |