将鼠标放在extj中的textfield文本中 [英] mouse over text for textfield in extjs
本文介绍了将鼠标放在extj中的textfield文本中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
comp = new Ext.form.TextField({
fieldLabel :'Name',
value:defVal,
width:width,
labelStyle:lblStyle,
blankText:'field required',
invalidText:'invalid text
});
我想为这个字段的鼠标悬停文本显示输入你的名字,当鼠标提示被移到场上。如何做?
解决方案
如果您使用Ext JS 3,并希望在您的字段的输入区域中添加一个工具提示(不在标签上),请尝试以下操作:
comp = new Ext.form.TextField({...}) ;
var tooltipText ='输入你的名字';
Ext.QuickTips.init();
Ext.QuickTips.register({
target:comp,
title:'',
width:250,
text:tooltipText
});
I have created a textField like this.
comp = new Ext.form.TextField({
fieldLabel : 'Name',
value : defVal,
width : width,
labelStyle : lblStyle,
blankText : 'field required',
invalidText : 'invalid text'
});
I want to have a mouse-over text for this field which displays 'enter your name' when mouse tip is moved over the field. How to do it?
解决方案
If you are using Ext JS 3 and want to add a tooltip over the input area of your field (not over the label), try the following:
comp = new Ext.form.TextField({...});
var tooltipText = 'Enter your name';
Ext.QuickTips.init();
Ext.QuickTips.register({
target: comp,
title: '',
width: 250,
text: tooltipText
});
这篇关于将鼠标放在extj中的textfield文本中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文