首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > JavaScript >

Extjs 中一个文本域如何获取光标

2012-03-01 
Extjs 中一个文本域怎么获取光标?1、浏览器加载页面的时候,光标直接会在指定的文本域(如:textfield)。2、页面

Extjs 中一个文本域怎么获取光标?
1、浏览器加载页面的时候,光标直接会在指定的文本域(如:textfield)。

2、页面加载完毕了,开始做验证,当某一项验证不通过时,光标回到此文本域中。

  谢谢啊! 请高手指点!

[解决办法]
试试这个方法

HTML code
  focus( Boolean selectText, Boolean/Number delay ) : Ext.Component 试着将焦点放到此项。Try to focus this component. 试着将焦点放到此项。Try to focus this component. 参数项: selectText : Boolean (可选的)true的话同时亦选中组件中的文本(尽可能)。(optional)If applicable, true to also select the text in this component delay : Boolean/Number (可选的)延时聚焦行为的毫秒数(true表示为10毫秒)。(optional) Delay the focus this number of milliseconds (true for 10 milliseconds) 返回值: Ext.Component this 

热点排行