zoukankan      html  css  js  c++  java
  • easyUi DataGrid 显示日期列,时间为空也可,的正常显示,及普通居中列情况

     $('#tt').datagrid({
                    url: '@Url.Content("~/kpi/FindList")',
                    "auto",
                    height: "auto",
                    fitColumns: true,
                    nowrap: false,
                    pagination: true,
                    pageNumber: 1,
                    singleSelect: false,
                    frozenColumns: [[{ field: 'ck', checkbox: true}]],
                    columns: [[

    普通列:

    { field: 'ProjectName', title: '项目名称', 120, align: 'center', styler: function (value, row, index) { return 'vertical-align:middle;'; } },

    居中显示列:

    { field: 'Id', title: '任务号', align: 'center', 50, formatter: function (val, rec) {
                             return "<div class='hiddenFontGommom devicetypes_a_box' >" + rec.Id + "</div>";
                         }
                         },

    时间显示列:

    { field: 'ImplementationBeginDate', title: '实施开始时间', align: 'center', 220, formatter: function (val, rec) {
                             var date = new Date(parseInt(rec.ImplementationBeginDate.substr(6)));
                             var dateTime = date.getFullYear() + "-" + ((date.getMonth() + 1).toString().length > 1 ? (date.getMonth() + 1) : "0" + (date.getMonth() + 1)) + "-" + (date.getDate().toString().length > 1 ? date.getDate() : ("0" + date.getDate()))
                         + "&nbsp;" + (date.getHours().toString().length > 1 ? date.getHours() : ("0" + date.getHours())) + ":" + (date.getMinutes().toString().length > 1 ? date.getMinutes() : ("0" + date.getMinutes())) + ":" + (date.getSeconds().toString().length > 1 ? date.getSeconds() : ("0" + date.getSeconds()));
                             return "<div class='hiddenFontGommom devicetypes_a_box' title=" + dateTime.replace(/ /g, "&nbsp;") + ">" + dateTime + "</div>";
                         }
                         },

    有时间为空的特殊时间显示列:

    { field: 'ImplementationEndDate', title: '实际完成时间', align: 'center', 220, formatter: function (val, rec) {
                             if (rec.ImplementationEndDate == null || rec.ImplementationEndDate == '') {
                                 return "<div class='hiddenFontGommom devicetypes_a_box' ></div>";
                             }
                             else {
                                 var date = new Date(parseInt(rec.ImplementationEndDate.substr(6)));
                                 var dateTime = date.getFullYear() + "-" + ((date.getMonth() + 1).toString().length > 1 ? (date.getMonth() + 1) : "0" + (date.getMonth() + 1)) + "-" + (date.getDate().toString().length > 1 ? date.getDate() : ("0" + date.getDate()))
                         + "&nbsp;" + (date.getHours().toString().length > 1 ? date.getHours() : ("0" + date.getHours())) + ":" + (date.getMinutes().toString().length > 1 ? date.getMinutes() : ("0" + date.getMinutes())) + ":" + (date.getSeconds().toString().length > 1 ? date.getSeconds() : ("0" + date.getSeconds()));

                                 return "<div class='hiddenFontGommom devicetypes_a_box' title=" + dateTime.replace(/ /g, "&nbsp;") + ">" + dateTime + "</div>";
                             }
                         }
                         },

    -------------------------

  • 相关阅读:
    storm源码分析之topology提交过程
    storm启动supervisor源码分析-supervisor.clj
    storm启动nimbus源码分析-nimbus.clj
    storm shell命令源码分析-shell_submission.clj
    storm定时器timer源码分析-timer.clj
    Storm在zookeeper上的目录结构
    storm操作zookeeper源码分析-cluster.clj
    Four subspaces
    拉格朗日量(函数)、达朗贝尔原理、哈密顿量
    离散正弦信号的周期
  • 原文地址:https://www.cnblogs.com/szlixin/p/4224150.html
Copyright © 2011-2022 走看看