【问题标题】:ExtJS GridPanel data tooltipExtJS GridPanel 数据工具提示
【发布时间】:2012-12-17 12:15:41
【问题描述】:

我想将工具提示添加到我的网格面板的数据中。我想把地图放在工具提示面板上,我明白了,但是我的静态地图的宽度是 600px,它从工具提示面板溢出。我使用下面的代码,它工作正常,但不能设置工具提示的宽度。我该怎么办?

this.renderToolTip = function(argVal, metadata, record, rowIndex, colIndex, store)
{
    var toolTipImg = '<img src="http://maps.googleapis.com/maps/api/staticmap?markers=color:green%7C' + record.data.latitude + ',' + record.data.longtitude + '&zoom=15&size=600x200&sensor=false" />';
    var title = record.data.title;

    return '<div ext:qtitle="' + title + '" ext:qtip="' + toolTipImg + '">' + argVal + '</div>';
};

【问题讨论】:

    标签: extjs tooltip extjs3 gridpanel extjs-grid


    【解决方案1】:

    试试这个:

    ...

    ext:qwidth="100"
    

    ...

    【讨论】:

    • 是的,没关系。我在哪里可以找到这种类型的标签?
    • 它对我有用。我还有一个问题。如果我在 argVal 上创建链接,它在悬停时不起作用。 return '&lt;div ext:qtitle="' + title + '" ext:qtip="' + toolTipImg + '"&gt;&lt;a href="test.html"&gt;' + argVal + '&lt;/a&gt;&lt;/div&gt;';
    【解决方案2】:

    对于 ExtJs4,这里是属性:

     tagConfig : {
            namespace : "data-",
            attribute : "qtip",
            width : "qwidth",
            target : "target",
            title : "qtitle",
            hide : "hide",
            cls : "qclass",
            align : "qalign",
            anchor : "anchor"
        },
    

    别忘了打电话:

    Ext.tip.QuickTipManager.init();
    

    在您的代码开始时。

    使用示例:

    meta.tdAttr = "data-qtip='texttttt' data-qtitle='title' data-qwidth=140"; 
    

    【讨论】:

      【解决方案3】:

      m.tdAttr = 'data-qwidth="160" data-qtip="'

      【讨论】:

        猜你喜欢
        • 2012-02-01
        • 1970-01-01
        • 2012-04-19
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2011-11-24
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多