2012-12-17 39 views
2

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

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>'; 
}; 

回答

1

试试这个:

...

ext:qwidth="100" 

...

+0

是的,这是确定在哪里可以找到这种类型的标签? – vtokmak

+0

这里http://www.objis.com/formationextjs/lib/extjs-4.0.0/docs/api/Ext.tip.QuickTipManager.html –

+0

它适用于我,我还有一个问题。如果我在argVal上创建链接,它不会在悬停时起作用 'return'

';' – vtokmak

0

为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"; 
0

m.tdAttr = '数据qwidth = “160” 数据qtip =“'