首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >如何以编程方式将工具提示添加到组合框

如何以编程方式将工具提示添加到组合框
EN

Stack Overflow用户
提问于 2018-05-25 16:59:17
回答 1查看 211关注 0票数 0

我试图用下面的代码在运行时向combobox添加提示,但它不起作用:

代码语言:javascript
复制
onStartReport: function (aButton) {
    var lTip = Ext.getCmp('datasources');
    lTip.setTooltip("Information on datasource");
}

我也尝试过这样做,但得到了一个错误:

代码语言:javascript
复制
onStartReport: function (aButton) {
     var tip = Ext.create('Ext.tip.ToolTip', {
     target: 'datasources',
     html: 'Information on datasource'
     });        
}

查看经典:

代码语言:javascript
复制
{
    xtype: 'combo',
    itemId: 'datasources',
    name: 'datasources',
    fieldLabel: 'Data sources',
    displayField: 'description',
    valueField: 'id',
    queryMode: 'local',
    value: 0,
    forceSelection: true,
    editable: false,   
    store: {
        data: [
            {id: 0, description: 'OnLine'},
            {id: 1, description: 'History'}
        ],
        fields: [
            {name: 'id', type: 'int'},
            {name: 'description', type: 'string'}               
        ],
        autoLoad: true
    }
}
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/50525315

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档