PDA

View Full Version : Can we modify the lib ?



mmc
17 Dec 2008, 5:34 AM
Hi,guys.
My depreesion is that our teammates modify Ext libs freqent, such as "form","grid" etc. They did not extends the Class but add some content to it's prototype. I realy hate these done. Try to persuade them but failed. Now ,our 'form' had many additonal items,and 'grid','panel',and so on.
I want to know that modus operandi is reasonable or not?
Realy wonder, THX!

Animal
17 Dec 2008, 6:11 AM
Most of us would be in deep doodoo if we didn't modify Ext in some way.

I have an ExtOverrides.js file containing scores of Ext.override(Ext.xxx.Xxxxx statements which fix problems and add capabilities.

mjlecomte
17 Dec 2008, 8:08 AM
I think it depends what you are doing.

Some things you may want to apply to all instances of a grid for example. So if you are applying a fix or some enhancement you want realized by all instances of grid, then sure, apply to the prototype.

If you only want some features periodically, then I'd say subclassing would be more appropriate for those items.

In either case, when you are modifying you should be using an external file to do so, not hacking inside ext-all.js for example. You're only asking for trouble when you upgrade if you go down that road.

mmc
25 Dec 2008, 7:21 PM
Thank you ,Animal and njlecomte. Now ,i had known how to do these problems.
Merry Christmas! \:D/