How to add Tooltip to jqgrid

自作多情 提交于 2019-12-09 03:18:47

问题


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?


回答1:


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.




回答2:


  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");


来源:https://stackoverflow.com/questions/4638480/how-to-add-tooltip-to-jqgrid

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!