DG3
DG3

Reputation: 5298

jqgrid change column title attribute

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

Upvotes: 3

Views: 15689

Answers (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..

Upvotes: 0

w.Bala
w.Bala

Reputation: 129

This can achieve by 2 steps

  1. You can simply disable the default tool tip by setting title:false
  2. write a global function and attached as a formatter in colModel

    var changeTitle = function(cellVal, options, rowObject){<br/>
        return  "&lt;div title='This is the cell value " + cellVal + "'>" + cellVal + "&lt;/div>";<br/>
    }
    
    colModel:[
    {...},<br/>
     {name:'priorityFlag', index:'priorityFlag', width:40, align:"center", formatter:   changeTitle },<br/>
    {...}]
    

There you go!...

Upvotes: 1

Arun Pratap Singh
Arun Pratap Singh

Reputation: 3646

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"'; }

Upvotes: 5

Oleg
Oleg

Reputation: 221997

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).

Upvotes: 1

Related Questions