【问题标题】:How to access the image which is inside extjs grid column header using jQuery如何使用 jQuery 访问 extjs 网格列标题内的图像
【发布时间】:2013-12-19 12:20:13
【问题描述】:

我在我的应用程序中使用 extjs 4 网格,这是我的代码:

{
    flex: 1,
    sortable: true,
    text: "<span  ' title='#{adminManager.licenseDesc()}'>License ? <img class=\"tooltips\" src=\"#{request.contextPath}/images/help2.jpg  \" height=\"18\" width=\"18\"/></span>",
    id: "rg",
    renderer: renderStatus,
    dataIndex: 'license',
    field: {
        xtype: 'combo',
        itemId:'license',
        emptyText:'Select',
        editable: false, 
        id:'govtOfficial',
        autoSelect:true,
        allowBlank: false,
        width:50,
        queryMode: 'local',
        store: new Ext.data.ArrayStore({
            fields: [
                'value',  
                'text'
            ],
            data: [['true', 'Yes'], ['false', 'No']]  
        }),
        valueField: 'value',
        displayField: 'text'
    }
}

现在我正在尝试使用“http://calebjacob.com/tooltipster/#demos”网站中的演示来实现工具提示文本。

我在页面的其他部分实现了同样的功能

<img src="#{request.contextPath}/images/help2.jpg " class="tooltips" style="margin-left: 165px;" title="#{AdminManager.licenseDesc()}" height="18" width="18"/>

并且我能够根据 class="tooltips" 访问元素并且它工作正常。但我无法访问基于以下类选择器的 extjs 网格列中的图像。

jQuery('.tooltips').tooltipster({
                   animation: 'fade',
                   delay: 200,
                   theme: '.tooltipster-default',
                   touchDevices: true,
                   trigger: 'hover',
                   interactive: true
                });

我了解 extjs 在运行时分配 id。如何访问 extjs 网格内的图片?

【问题讨论】:

  • 你能告诉我们DOM的相关部分吗?

标签: javascript jquery extjs extjs4.1


【解决方案1】:

您可以使用 ExtJS 对象的dom 属性。 $(MyComponent.dom).whatever();

【讨论】:

    猜你喜欢
    • 2011-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-07-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-09-02
    • 1970-01-01
    相关资源
    最近更新 更多