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.
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.
To highlight and assign a tooltip to an entire row, using jqgrid 4.4 and IE 11, this works.
turn off tooltip in all cells when defining the colModel, for example:
colModel: [ { name: 'ColumnName', title: false },...
assign a loadComplete method to the grid:
} }
I had a similar problem, where jQuery just WOULD NOT recognize a mouseover even though the class was set correctly. As a test I setup
No results. Then I changed it to
and it worked. It was all about loading order. Hope this helps.
I would like to extend my answer for using
bootstrap
tooltip with jqGrid. Grid sets a tooltip by default which could be cleared usingtitle:false
for each column.To select a particular
td
orcell
we could create our own class/attribute usingcellattr
property as a function for any cell. For example:Then finally, bootstrap function
tooltip
could be called on a single or a collection ofcells/td
:container:body
needs to be used to maintain the behavior ofhtml
tables.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.Use a custom formatter
And then use this formatter in the col model
There is no jqGrid API for this. If you want to change the tooltip text you will have to write code to manually change the value of the cell's
title
element.