PDA

View Full Version : Updating an Older ExtJS Version With A New ExtJS Method



elshae
27 Jan 2011, 2:42 PM
Hello ExtJS List,

It may sound really silly, but I'd like to edit the files of an ExtJS 3.2.1 copy I have and add a method from ExtJS 3.3.0/3.3.1. I tried editing a few files, in my case TreeNode.js, TreeNodeUI.js, and ext-all.js. The new method I want is the TreeNode.setIconCls().

In TreeNode.js I added:
/**
* Sets the icon class for this node.
* @param {String} cls
*/
setIconCls : function(cls){
var old = this.attributes.iconCls;
this.attributes.iconCls = cls;
if(this.rendered){
this.ui.onIconClsChange(this, cls, old);
}
}

In TreeNodeUI.js I added:
// private
onIconClsChange : function(node, cls, oldCls){
if(this.rendered){
Ext.fly(this.iconNode).replaceClass(oldCls, cls);
}
},

And in ext-all.js:
after Ext.tree.TreeNode =
setIconCls:function(b){var a=this.attributes.iconCls;this.attributes.iconCls=b;if(this.rendered){this.ui.onIconClsChange(this,b,a)}}

and after
Ext.tree.TreeNodeUI =
onIconClsChange:function(c,a,b){if(this.rendered){Ext.fly(this.iconNode).replaceClass(b,a)}}

I know that this isn't recommended practice, but I am using GeoExtJS 1.0 which seems to have issues with ExtJS 3.3.X (unless I've done something wrong), but when I roll back to ExtJS 3.2.1 I don't have these issues...however, I loose the setIconCls function which was packaged only with versions 3.3.0 and up..

I'll appreciate any feedback :)

Thank you,

elshae

elshae
28 Jan 2011, 7:17 AM
I hope I'm not posting my questions wrongly/in the wrong place. I notice that they are indexed grey as opposed to the other post indexed blue and never get any responses! :p