JqGrid disable row highlighting

How can you programmatically disable a grid from highlighting a row when you hover over it? If you want to disable it only at certain times.


This is the code from Oleg who worked:

$('#result-close').click(function() { //Turn off hover highlighting $("#list").unbind('mouseover'); $("#list").unbind('mouseout'); //Highlight row $("#" + selid).effect("highlight", {}, 5000); //Turn on hover highlighting setTimeout(function(){ $("#list").bind('mouseover',function(e) { ptr = $(e.target).closest("tr.jqgrow"); if($(ptr).attr("class") !== "subgrid") { $(ptr).addClass("ui-state-hover"); } return false; }).bind('mouseout',function(e) { ptr = $(e.target).closest("tr.jqgrow"); $(ptr).removeClass("ui-state-hover"); return false; }); }, 2000); $('#dialog').dialog( "close" ); }); 
+6
jquery highlight jqgrid
source share
3 answers

Use hoverrows:false option .

+22
source share

A simple Google search showed this source: http://www.trirand.net/examples/appearance/highlight_on_hover/default.aspx

"The default is jqGrid hightlight rows on hover. This is controlled by the AppearanceSettings.HighlightRowsOnHover property - setting it to false will disable this."

0
source share

I am currently replacing the existing mouseover handler with an intermediate function that simply calls the existing handler if the grid is turned on, for example:

 var enabled = true; var jqe = jQuery("#grid"); var mouseover = jqe.data('events').mouseover[0].handler; jqe.unbind('mouseover'); jqe.bind('mouseover', function() { if (enabled) { mouseover.apply(this, arguments); } }); 

This way I do not need to copy the jqgrid event code.

I do not like using mouseover [0] .handler, but it is working at the moment.

0
source share

All Articles