thalla thalla - 2 months ago 29
jQuery Question

JQgrid : disable table header mouse hover style

How to disable jqgrid table header hover style.
I tried answer from this solution from another stackover flow question,

$($("#gridId")[0].grid.hDiv).find(".ui-jqgrid-labels th.ui-th-column")

it disable the header hover style but shows some error in console

Uncaught TypeError: Cannot read property 'grid' of undefined(…)


I suppose that you executed the code before the grid is created. You should just move the code to the correct place. See, which uses

    .off("mouseenter mouseleave");

By the way you can move the code inside of onInitGrid callback, which will be called after the outer part of the grid (for example column headers) are created:

onInitGrid: function () {
        .find(".ui-jqgrid-labels th.ui-th-column")
        .off("mouseenter mouseleave");