PDA

View Full Version : Grid Cell Quicktips



Lloyd K
13 Feb 2008, 4:02 AM
Is it possible to diaply a quicktip for a grid cell and if so how? In Ext 2.0 we have a new QuickTip class with a showAt() and all and I've kind of got it working there but I can't seem to replicate the functionality in Ext 1.x.

The problem is I want to show a quicktip for the cell contents so that obscured content can be shown, kind of like how most spreadsheets work.

fay
13 Feb 2008, 7:33 AM
Add a renderer (http://extjs.com/deploy/ext/docs/output/Ext.grid.ColumnModel.html#config-renderer) for your cell:


function renderGridCell(value, metadata, record, rowIndex, colIndex, store)
{
metadata.attr = 'ext:qtip="' + value + '"';
return value;
}

rogueMonkey@gmail.com
13 Feb 2008, 8:34 AM
Unfortunately, this seems to put a quicktip on the div residing inside the table td. If my first cell in my row spans two lines, and the second one only one (like so, sorry for the crude ASCII):


-------------------------------------
| text spanning | text on one line |
| two lines | |
-------------------------------------
Then the tooltip will only work on the upper part of my second cell because the inner-div does not take all the available vertical space of it's containing td.

Is there either a way to put the quicktip on the cell's td, or a way for the div to span the whole td (frantic googling seems to suggest there isn't)?


Add a renderer (http://extjs.com/deploy/ext/docs/output/Ext.grid.ColumnModel.html#config-renderer) for your cell:

function renderGridCell(value, metadata, record, rowIndex, colIndex, store)
{
metadata.attr = 'ext:qtip="' + value + '"';
return value;
}