在为tpl放置input类控件时,即使使用了 textareafield控件.focus(); 但是,textarea 控件还是没有显示聚焦的光标.
主要原因
被放入到tpl中的input类控件,focus方法里 在 canFocus方法中,有了判断,返回为false或undefined造成。
解决方法
在向tpl里的dom 插入 extjs控件的el之前,先设置textarea的dom的autofocus为true,放入后,在用dom元素聚焦
textField.getFocusEl().dom.autofocus=true;
tplDOM元素.append(textField.el);
textField.getFocusEl().dom.focus();