必定要在这个事件当中添加这段代码
css
onLoadSuccessthis
$("#datagridWrapId .datagrid-body tr").click(function (){
var color=$(this).css("background-color");
if(color=='rgb(221, 221, 221)'){
$(this).css("background-color","rgb(140, 188, 194)");
}else if(color=='rgb(140, 188, 194)'){
$(this).css("background-color","rgb(221, 221, 221)");
}
});事件
注意,我以前在rowStyler中设置的背景颜色为rgb(221, 221, 221),逻辑关系很简单,当颜色为a时,颜色换成b,当颜色为b时颜色换成aio