Jqgrid change column header attribute

When you hover over a specific cell value, the hover value matches the cell value. Can I change the guidance text other than the cell value?

thank

+3
source share
4 answers

In general, a tooltip is an attribute of titleelements <td>. You can use setCell to change the tooltip (see this ). In more complex situations, you can use jQuery.attr (see here ), or you are a tooltip plugin (see here ).

+1
source

cellattr colModel , .

cellattr: function () { return ' title="my custom fixed tooltip for the column"'; }
+4

It can reach 2 steps

  • You can simply turn off the default prompt by setting title:false
  • write a global function and paste as formatting 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! ...

+1
source
  • You can right click the title
  • Examine the column id name, for example: PersonelGrid_DefViewMainPage
  • Install you after the grid to download this code ..

    $("#PersonelGrid_DefViewMainPage").attr("title", "This is my Title.");

it works..

0
source

Source: https://habr.com/ru/post/1786718/


All Articles