问题
When I hover over a particular cell value, the hover value is same as the cell value. Can I change the hover text different from the cell value?
Thanks
回答1:
In general the tooltip is the title
attribute of the <td>
elements. You can use setCell method to change the tooltip (see this). In more complex situations you can use jQuery.attr (see here) or you a tooltip plugin (see here).
回答2:
You can use cellattr attribute in the colModel for a column to set custom tooltip. For example
cellattr: function () { return ' title="my custom fixed tooltip for the column"'; }
回答3:
This can achieve by 2 steps
- You can simply disable the default tool tip by setting
title:false
write a global function and attached as a formatter in colModel
var changeTitle = function(cellVal, options, rowObject){<br/> return "<div title='This is the cell value " + cellVal + "'>" + cellVal + "</div>";<br/> } colModel:[ {...},<br/> {name:'priorityFlag', index:'priorityFlag', width:40, align:"center", formatter: changeTitle },<br/> {...}]
There you go!...
回答4:
- You can right click title
- Learn a column ID name ex:PersonelGrid_DefViewMainPage
Set you after grid load this code..
$("#PersonelGrid_DefViewMainPage").attr("title", "This is my Title.");
it's work..
来源:https://stackoverflow.com/questions/4749874/jqgrid-change-column-title-attribute