How can you set the "tool tip" that appears when you hover your mouse over a jqGrid row/cell?
Currently the tool tip appears to just be the cell contents.
jqgridjquerytooltip
How can you set the "tool tip" that appears when you hover your mouse over a jqGrid row/cell?
Currently the tool tip appears to just be the cell contents.
Best Answer
In general I agree with Justin, that jqGrid get you no direct way to set tooltip on the row, you can do this only on the cell basis. So you have to do this manually.
First of all you should set title:false property on all cells to have no tooltip for the cells. Then you have to set your custom tooltips of every row. You can do this for example inside of loadComplete event handle. The corresponding code can be about following:
You can see the corresponding example you can see live here.
UPDATED: In more late versions of jqGrid there are much more effective way to set custom
title
. It's the usage ofcellattr
(see the answer for an example) or the usage ofrowattr
(see the answer). I recommend to usegridview: true
option of jqGrid always. The usage ofcellattr
orrowattr
together withgridview: true
allows to create full grid body inclusive of all tooltips which one need in one modification of the page (the full HTML fragment of grid body inclusive of all tooltips will be assigned toinnerHTML
property). The usage of.attr
in the loop follows at least to reflow which is expansive (see here). So the usage ofcellattr
androwattr
in combination withgridview: true
allow to achieve the best performance.