jquery - jqgrid : how to change the class of one cell (when mouse is over on)?

标签 jquery jqgrid

我设置网格第一列的单元格,其类如下:

$("#myGrid").jqGrid('setCell',rowid,'column_1', '', '**ui-state-default**');

当鼠标悬停在单元格上时,如何更改单元格的类?

最佳答案

这个怎么样?

$("#myGrid").hover(function(){
        $(this).find("td:first").css("background-color", "black");
    });

编辑

 $("#myGrid tr").hover(
              function(){
              $(this).find("td:first").addClass('ui-state-hover');
              },
              function(){
              $(this).find("td:first").removeClass('ui-state-hover');
              }   
            );

或者

$("#myGrid tr").mouseenter(function(){
      $(this).find("td:first").addClass('ui-state-hover');
    }).mouseleave(function(){
      $(this).find("td:first").removeClass('ui-state-hover');
    });

关于jquery - jqgrid : how to change the class of one cell (when mouse is over on)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2882899/

相关文章:

javascript - 在多选列表中设置选定值

javascript - Jquery .data(),如何检索具有匹配值的元素?

jQuery.attr ("style") 与 jQuery.css()

jquery-ui - 在 jqGrid 列标题中使用图标?

javascript - 如何显示 jqGrid 中的所有行?

JavaScript toString() 问题

javascript - asp.net动态多文件上传

javascript - jqGrid - 'in' op 不适用于过滤器

javascript - Jquery $(this) 被 jqgrid gridunload 方法破坏了吗?

jqgrid - 垂直列方向