Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1405
Add tooltip to Grid
posted

Hi,

Can someone tell me how to add a tooltip on each cell of all the rows of parent and child grids of webhierarchicaldatagrid on client-side. Currently I am using this function:

function initGrid(grid, args) {
    
      var rows = grid.get_rows();
      var rowCount = rows.get_length();
      var cellCount = rowCount > 0 ? rows.get_row(0).get_cellCount() : 0;
      for (var r = 0; r < rowCount; ++r) {
         var row = rows.get_row(r);
         for (var c = 0; c < cellCount; ++c) {
             var cell = row.get_cell(c);
             var cellEl = row.get_cell(c).get_element();
             cellEl.title = "Message";
         }
     } 
  }

It adds the tooltip to parent rows but how to add the same message for all the child rows also.

Thanks,

Megha

Parents
  • 33839
    Suggested Answer
    posted

    Hi Megha,

    You could handle the InitializeRow and set the Tooltip on the cells on the server side.  If you want to do it client side that is fine, but you'll need to go through the child grids.  Each row has row.get_rowIslands() which returns an array.  Then you would need to get childGrid = row.get_rowIslands()[0] and do the same thing.  If you know your levels, you could hard code it.  If it is variable, I suggest turning this code into a recursive method where you pass in a grid to set tooltips for, then recursively call it with child grids.

    regards,
    David Young 

Reply Children