zoukankan      html  css  js  c++  java
  • ExtJS GridPanel根据条件改变字体颜色

    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> 

  • 相关阅读:
    java内存溢出
    jstack命令使用
    JVM问题排查步骤
    c++指针常量和常量指针
    c++ 通讯录
    冒泡排序
    翻转数组
    敲桌子
    求一个100-999之间的水仙花数
    elasticsearch 模板的使用
  • 原文地址:https://www.cnblogs.com/easypass/p/1680808.html
Copyright © 2011-2022 走看看