`
wly719
  • 浏览: 286931 次
  • 性别: Icon_minigender_2
  • 来自: 杭州
社区版块
存档分类
最新评论

Ext.form.ComboBox 加tip

EXT 
阅读更多

当有时候我们combobox框里面的值太长,定义一定的长度,不能完全看见,这是就需要加tooltip,当鼠标悬浮时,出现完整的字符。
具体代码实现:

一个combobox框
var operateEvent = new Ext.form.ComboBox({
fieldLabel:'操作事件',
width:150,
valueField:'value',
displayField:'name',
triggerAction: 'all',                     
selectOnFocus:true,
hiddenName:'operation',
tpl :tpl,
store:operationEventStore,
editable:false
});
var tpl = '<tpl for="."><div class="x-combo-list-item" ext:qtitle="值" ext:qtip="{name}">{name}</div></tpl>';
tpl是var tplO = new Ext.XTemplate()里面的字符串,在combox里面定义配置项tpl:相当于创建一个模板对象。
然后在<div>中加ext:qtip;
必须加上   Ext.QuickTips.init(); 上面功能才能实现。
效果如下:


  • 大小: 6 KB
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics