0

I am new to flexigrid but there isnt much documentation or examples on How can a tooltip and multiline tooltip be added to each cell in flexigrid tables and to the table headers.

Are there any example and samples for flexigrid tooltip?

THanks

about flexigrid http://flexigrid.info/

user244394
  • 13,168
  • 24
  • 81
  • 138

1 Answers1

0

I managed to get tool tips working using the following code.

function loadToolTips(){
$('#Employees tr').each( function(){

            var tooltip = 'Employee Code : '
            tooltip = tooltip + $('[abbr="EmployeeCode"]',this).text();
            tooltip = tooltip + '<br />';

            tooltip = tooltip + 'Name: ' 
            tooltip = tooltip + $('[abbr="Name"]',this).text();
            tooltip = tooltip + '<br />';

            tooltip = tooltip + 'Department: ' 
            tooltip = tooltip + $('[abbr="Department"]',this).text();
            tooltip = tooltip + '<br />';

            tooltip = tooltip + 'Section: ' 
            tooltip = tooltip + $('[abbr="Section"]',this).text();

            $("td", this).each(function() {
                var $TableCell = $(this);
                $TableCell.attr("title", tooltip);
                $TableCell.addClass("tooltip");
            });
        });
$('.tooltip').tooltipster();

}

I first iterate through all of the rows in the grid and build up the tool tip by getting the values from each cell in the row by using the abbr's.

for each cell within the row I then add the title attribute with the tool tip value.

I also add a class tool tip but this is only because I am using tooltipster.

I call the loadToolTips function when the onSuccess method is called.

preProcess: somefunction,
onSuccess: loadToolTips
Alex Shesterov
  • 26,085
  • 12
  • 82
  • 103