写控件编辑后事件里
var f;
var a;
var c = this.editComp.val();
if (c && c.length > 0) {
f = f === undefined ? 0 : f;
a = a === undefined ? c.length : a;
var e = this.editComp[0];
if (e.setSelectionRange) {
e.setSelectionRange(f, a)
} else {
if (e.createTextRange) {
var b = e.createTextRange();
b.moveStart("character", f);
b.moveEnd("character", a - c.length);
b.select()
}
}
}