Author Topic: Setting ToolTip Text  (Read 3237 times)

mshapiro

  • Pro Enterprise
  • Newbie
  • *
  • Posts: 35
    • View Profile
Setting ToolTip Text
« on: August 20, 2014, 05:01:39 am »
I am attempting to set tooltip text on all the cells in one column in the grid.  I am using the render callback on that column and the jQuery UI tooltip widget, but I haven't been able to get it to work.  Is this the correct place to do this?  Some sample code would be appreciated.  Thanks.

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6309
    • View Profile
Re: Setting ToolTip Text
« Reply #1 on: August 20, 2014, 10:56:43 am »
column.render is the right place to define title for tooltip.

Code: [Select]
render: function (ui) {
                   var cellData = ui.cellData;
                   return "<div title=\"" + cellData + "\">" + cellData + "</div>";
               }

and to initialize jQueryUI tooltip, write the following code in jQuery.ready()

Code: [Select]
  $(document).tooltip();


Example: (Please note this example is for basic version but basic idea for tooltip remains the same)
http://jsfiddle.net/paramquery/L2ov1suo/
« Last Edit: August 20, 2014, 10:59:13 am by paramquery »

mshapiro

  • Pro Enterprise
  • Newbie
  • *
  • Posts: 35
    • View Profile
Re: Setting ToolTip Text
« Reply #2 on: August 21, 2014, 03:34:45 am »
Than you.  This is exactly what I was looking for.