必定要在這個事件當中添加這段代碼
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