下面是我的easyui 列的代码,我需要根据actType修改actCname的样式
columns:[[ {field:'actCname',title:'权限名称',width:350,align:'left', formatter:function(value){ return '<span style="color:black">'+value+'</span>'; }}, {field:'actEname',title:'权限标识',width:200,align:'left'}, {field:'actType',title:'类型',width:60,align:'center', formatter:function(value){ if(value=='menu'){ return "菜单"; }else if(value == "link"){ return "链接"; }else if (value == "lock"){ return "锁"; }else{ return "action"; } } }, {field:'fullEname',title:'英文全称',width:400,align:'left'} ]]
onLoadSuccess:function(row){ var panel = $('#actList').datagrid('getPanel'); var tr = panel.find('div.datagrid-body tr'); tr.each(function(){ var td = $(this).children('td[field="actType"]'); var td2 = $(this).children('td[field="actCname"]');//这是我要修改的列 var textValue = td.children("div").text(); var textValue2 = td2.children("div").text(); //alert(textValue+":"+textValue2); if(textValue == '链接'){ td2.children("div").css({ "text-decoration":"underline"//添加个下划线 }); }; }); }