This is a migrated thread and some comments may be shown as answers.

Grid Hover broke on 2014.3.18

1 Answer 40 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jon
Top achievements
Rank 1
Jon asked on 26 Mar 2014, 10:36 AM
Been using suggestion from: http://www.telerik.com/forums/grid-row-hover-effect, but the latest patch breaks.

function addExtraStylingToGrid() {
    $(".k-grid > table > tbody > tr").hover(
      function () {
          $(this).toggleClass("k-state-hover");
      }
    );
};

1 Answer, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 26 Mar 2014, 12:05 PM
Hi Jon,

The provided code will work only if scrolling is disabled. Is this your scenario?

You can do the following test:

1. Open http://demos.telerik.com/kendo-ui/web/grid/remote-data.html

2. Open the browser's Javascript console.

3. Execute

$("#grid").data("kendoGrid").bind("dataBound", function(e) {
   e.sender.tbody.children().hover(function() {
      $(this).toggleClass("k-state-hover");
   });
});

4. Page, sort or filter the Grid

5. Try hovering some rows - the hover style will be applied.

Notice that the above approach has several advantages - it does not hard-code selectors, it will influence only one Grid instance on the page, and it will also work for both scrolling and non-scrolling scenarios.

Regards,
Dimo
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Grid
Asked by
Jon
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Share this question
or