yui--datatable 行添加格式

 

采用formatter


 

 

YAHOO.widget.DataTable.Formatter.changeLight=function(elCell, oRecord, oColumn, oData){
      elCell.innerHTML = "<img src='../MonitorManage/images/gray_lamp.png'>";
};

{key:"ONLINESTATUS", label:"状态",width:30,resizeable:true,sortable:true,formatter:"changeLight"},

 

 

 

js操作


 

通过获取到行记录的id然后操作

 

var records = myTable.getRecordSet().getRecords();
var  i, len,id;
for(i=0,len=records .length; i<len; i++){
   id = records[i].getId();
   if(...){
       $("#"+id).attr('style','background:#FF9797;');
      
       }
            
}

 

 

 

posted @ 2014-05-19 14:22  wishyouhappy  阅读(378)  评论(0编辑  收藏  举报