zoukankan      html  css  js  c++  java
  • EasyUI 中GridView 满足某条件 改变行的背景色

    <table id='grid' class='easyui-datagrid' style='1500px;height:450px' url='Ajax-index.php?module=<{$module_name}>&action=Ajax_GridView_Select_Dispose&assigned_user_id=<{$assigned_user_id}>&start_time=<{$start_date}>&stop_time=<{$stop_date}>'
    title='投诉列表' iconCls='icon-table' pagination='true' rownumbers='true' fitColumns='true' singleSelect='true' toolbar='#toolbar'
    data-options="rowStyler: function(index,row){ return RowStyle(index,row); }" >
    <thead>

    重点:data-options="rowStyler: function(index,row){ return RowStyle(index,row); }" 

    <script type='text/javascript'>
    function RowStyle(index,row){
      //alert(row.send_date);//undefined  //取行中的列值
      if(row.send_date!=undefined){
        var date_now=GetDateTime();//alert(date_now);//取当前时间
        date_diff=GetDateDiff(row.send_date, date_now, "day");//alert(date_diff);//时间差
        //var date_diff=GetDateDiff("2010-02-26 16:00:00", "2011-07-02 21:48:40", "day");alert(date_diff);//时间差
        if(date_diff>2){//超过2天时 红色背景色
          return 'background-color:#CF0C29;color:#fff;font-weight:bold;';
        }
      }
    }

    </script> 

  • 相关阅读:
    My Eclipse
    那一夜,我被梦中笑醒的事之(数据库)
    KTV项目总结
    欢迎来到,数据库联盟!
    学习手工创建表,表关系以及用exists 来查询
    sql 将Null 值转化成空字符串
    jquery toggle
    推荐一个不错的配色网站
    css之zindex
    关于前后端分离与不分离
  • 原文地址:https://www.cnblogs.com/hailexuexi/p/5175633.html
Copyright © 2011-2022 走看看