Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add Tooltip to jqgrid

Tags:

tooltip

jqgrid

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?

like image 913
RPB Avatar asked Jan 09 '11 09:01

RPB


2 Answers

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.

like image 131
Oleg Avatar answered Oct 20 '22 18:10

Oleg


  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");
like image 29
Paresh Vaniya Avatar answered Oct 20 '22 17:10

Paresh Vaniya