PDA

View Full Version : Automate unselectable()


Choleriker
03-02-2007, 09:27 AM
Hello,

it was crap to make the needed elements unselectable so i get an idea. The following method is an extension to the Ext.Element class which simply let you make all containing elements unselectable based on their class. If you dont give the class to this method, it will make all Elements with the css class unselectable unselectable. :lol:


Ext.Element.prototype.ensureUnselectable = function(cssClass) {
if(typeof cssClass=='undefined') cssClass='unselectable';
Ext.id(this);
Ext.select('#'+this.dom.id+' .'+cssClass).unselectable();
};


You can bind it now maybe to the UpdateManager update event like i explained in an previous sample.

Has any1 an idea how to make it as an default for the whole page?