I wanted to point out that the following code fragment can be simplified:
// current
$(ts).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;
});
// new
$(ts).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;
});
There is no need to again do $(ptr)
Copyright 2014 TriRand LtdAll Rights ReservedRSS
Back to Top