为extjs中的每个类型设置td颜色

时间:2013-09-23 14:05:00

标签: javascript html5 css3 extjs

我希望每个请求类型必须以CSS类名称的不同颜色显示。

代码:

mcmShowTaskMessageBox: function(task, menu) {       
    var message = '<table class="eventTipBig">';
    var requestType = task.get('RequestType');      
    var alert = task.get('Alerts');         
    if(requestType === 'OA VIP') {          
        menu.tdCls = 'OAVIP';       
    } else if(requestType === 'JL VIP') {           
        menu.tdCls = 'JLVIP';
    } else if(requestType === 'BA VIP') {           
        menu.tdCls = 'BAVIP';
    } else if(requestType === 'IB VIP') {           
        menu.tdCls = 'IBVIP';       
    } else if(requestType === 'QF VIP') {           
        menu.tdCls = 'QFVIP';       
    }       
    message += 
    '<tr>' + 
        '<td class="icon-task">Name</td>' + 
        '<td class="value">' + task.get('Name') + '</td>' + 
    '</tr>' + 
    '<tr>' + 
        '<td class="icon-task">Ranking</td>' + 
        '<td class="value" style="color:red;">' + PriorityGreet + '</td>' + 
    '</tr>' +
    '<tr>' + 
        '<td class="icon-task">Request Type</td>' + 
        '<td class="value">' + requestType + '</td>' +
    '</tr>' + 
    '<tr>' + 
        '<td class="icon-task">Agent</td>' + 
        '<td class="value">' + task.get('AgentName') + '</td>' +
    '</tr>' + 
    '<tr>' + 
        '<td class="icon-task">Service Type</td>' + 
        '<td class="value">' + task.get('TaskType') + '</td>' +
    '</tr>' + 
    '<tr>' + 
        '<td class="icon-task">Task Status</td>' + 
        '<td class="value">' + task.get('TaskStatus') + '</td>' +
    '</tr>' + 
    '<tr>' + 
        '<td class="icon-task">Task Category</td>' + 
        '<td class="value">' + task.get('TaskCategory') + '</td>' +
    '</tr>'+
    '<tr>' + 
        '<td class="icon-task">Notes</td>' + 
        '<td class="value">' + task.get('Notes') + '</tr>' +
    '</tr>' + 
    '</table>';         

   App.mcmShowMessageBox({          
       id: 'TaskGrid' + task.get('Id'),             
       title: 'Task Information',           
       message: message,            
       editOption: { task: task, menu: menu }       
    });         
//modification ended    
}

0 个答案:

没有答案