jqgrid change column title attribute

2020-07-22 19:12发布

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

标签: jquery jqgrid
4条回答
对你真心纯属浪费
2楼-- · 2020-07-22 19:20
  • 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..

查看更多
迷人小祖宗
3楼-- · 2020-07-22 19:27

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

查看更多
【Aperson】
4楼-- · 2020-07-22 19:35

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"'; }
查看更多
我想做一个坏孩纸
5楼-- · 2020-07-22 19:36

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

查看更多
登录 后发表回答