在点击TextEditor编辑框后,默认是选中编辑框内的全部内容,去掉默认选择内容这个效果

来源:互联网 发布:免备案域名加速 编辑:程序博客网 时间:2024/04/29 17:34

这个是在官网上问的问题.

下面是bean的回复:

 

function $EI() {
this._hasFocus = true;
$Yq.call(this);
if (this.select) {
clearTimeout($3o);
$3o = setTimeout("document.getElementById(/"" + this.id + "/").select();", 10);
}
var $m$ = this.getDropDown();
if ($m$ != null && !this.$nC) {
var $I0;
if (this.$LY != 2) {
$I0 = $PZ.call(this);
$sD($I0, "DropDownButton");
if (this.readOnly) {
$I0.focus();
}
} else {
$I0 = this.$sz;
}
var $Uc = this;
if ($m$.$oG && !$m$.isOpened()) {
this.$Ti = setTimeout(function () {
$m$.open($Uc);
}, 50);
}
}
fireDoradoEvent(this, "onFocus", [this]);
}

function $Fl() {
var $6O = this._currentCell;
var $Uc = null;
if ($6O != null && $6O.$GC != null) {
$Uc = this.$b3($6O);
}
if ($Uc != null) {
$Uc.$Ed = $6O;
$Uc.setRecord(this.$kd.$y);
$Uc.refresh();
$Uc.style.zIndex = $IC();
__setDisplay($Uc, true);
this.$C8($Uc);
var $Zz = ($me == $Uc);
$Uc.focus();
if ($Uc.select) {
setTimeout("document.getElementById(/"" + $Uc.id + "/").select();", 0);
}
if ($Zz) {
$Uc.onFocus();
}
}
this.$cK = $Uc;
}

 

将上面两个方法的setTimeout那句都给注释掉,把这两个方法放到公用的js里面。