Ext.onReady(function() {
var form = new Ext.form.FormPanel({
renderTo : document.body,
layout : 'form',
items : [{
xtype : 'textfield',
fieldLabel : 'test',
value : 'test',
listeners : {
'focus':function(){
this.selectText();
}
}
}]
})
});
原创地址:[url]http://www.iteye.com/problems/15498[/url]
var form = new Ext.form.FormPanel({
renderTo : document.body,
layout : 'form',
items : [{
xtype : 'textfield',
fieldLabel : 'test',
value : 'test',
listeners : {
'focus':function(){
this.selectText();
}
}
}]
})
});
原创地址:[url]http://www.iteye.com/problems/15498[/url]
本文提供了一个使用ExtJS创建表单面板的例子,该面板包含一个文本字段,当获得焦点时会自动选中其内部的文本。通过监听'focus'事件并调用'selectText'方法实现。
967

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



