Ext.core.Element.prototype.unselectable = function() {
var me = this;
if (me.dom.className.match(/(x-grid-table|x-grid-view)/)) {
return me;
}
me.dom.unselectable = "on";
me.swallowEvent("selectstart", true);
me.applyStyles("-moz-user-select:none;-khtml-user-select:none;");
me.addCls(Ext.baseCSSPrefix + 'unselectable');
return me;
};
I copied the code from http://kevin.chibaole.com/135
本文介绍了一种使用Ext核心Element原型扩展的方法来防止DOM元素被选中,通过修改元素样式和事件监听实现。

被折叠的 条评论
为什么被折叠?



