Posted in Javascript onMarch 08, 2010
1、在GridPanel中加入GridView
<View> <ext:GridView ID="GridView1" runat="server"> <GetRowClass Fn="setRowBg" /> </ext:GridView> </View>
2、加入js脚本
<script language="javascript" type="text/javascript"> function setRowBg(rd, ri, ro) { var zhb,lj,xzh; zhb=rd.data.zhb; lj=rd.data.lj xzh=rd.data.xzh; if (xzh=="正向") { if (zhb>lj) { ro.tstyle = "color: #F57D02; "; } else { ro.tstyle = "background-color:none;"; } } if (xzh=="反向") { if (zhb<lj) { ro.tstyle = "color: #FFE37E; "; } else { ro.tstyle = "background-color:none;"; } } } </script>
ExtJS GridPanel 根据条件改变字体颜色
声明:登载此文出于传递更多信息之目的,并不意味着赞同其观点或证实其描述。
Reply on: @reply_date@
@reply_contents@