5

I am using jqgrid to display data present in server how do i show description of data on mouse hover tool tip.

which is the best way to show tool tip on jqgrid?

RPB
  • 16,006
  • 16
  • 55
  • 79

2 Answers2

13

Tooltip shown in jqGrid on mouse hover is nothing more as the "title" atribute of the corresponding HTML elements. If you want change tooltip with setCell:

$("#list").setCell(rowid,'Name','','',{'title':'my custom tooltip on cell'});

where the 'Name' is the column name where the tooltip will be set and rowid identify the row. For more informaion read this answer including the references.

Oleg
  • 220,925
  • 34
  • 403
  • 798
1
  var setTooltipsOnColumnHeader = function (grid, iColumn, text){
      var thd = jQuery("thead:first", grid[0].grid.hDiv)[0];  
      jQuery("tr.ui-jqgrid-labels th:eq(" + iColumn + ")", thd).attr("title", text);
     };


and just set tooltip on header column

setTooltipsOnColumnHeader ($("#empgrid"), 4, "Invoice No");
setTooltipsOnColumnHeader ("GRID NAME", "COLUMN" , "TOOLTIP TEXT");
Paresh Vaniya
  • 41
  • 1
  • 8
  • 2
    For tooltips over header elements you can use `setLabel`. The signature of that call is similar to `setCell`, except that you don't specify rowid. Example: `$("#ajaxGrid").setLabel('Name', '', '', { 'title': "Project Name" });` – Csaba Toth Aug 02 '15 at 04:22