1

I add dynamically a tooltip to each cell in a grid in this way:

renderer : function(value, metadata, record)
{
    metadata.attr = 'ext:qtip="' + value + '" ext:qwidth="auto"';
    return value;
}

It works fine for small text. But when the text is long, that the tooltip have to be larger than 500px, then that tooltip looks really bad. I know that maximum supported width by Sencha is 500px, but I found a solution here: http://forums.ext.net/showthread.php?15634-Overcoming-ExtJs-Tooltip-s-max-width-of-500. Unfortunately I don't know how to set that baseCls to my qtips in metadata.attr. I was traying with:

Ext.Tip.prototype.baseCls = 'custom-x-tip';

But it doesn't change anything. Of course, I have that css class defined in my css file.

4

1 回答 1

0
renderer : function(value, metadata, record)
{
    return getToolTip(value, metaData,record);
}

/** For ExtJS 4.x */
function getToolTip(value, metaData,record){
    metaData.tdAttr = 'data-qtip="' + value + '"';
    return value;
}

> 从这里编辑我的答案:

/** For ExtJS 3.x */
function getToolTip(value, metadata, record, rowIndex, colIndex, store){
    metadata.attr = 'ext:qtip="' + value + '"';
    return value;
}
于 2013-10-07T13:33:51.233 回答