zoukankan      html  css  js  c++  java
  • easyUI中遇到的时间函数问题 skyCc

    在java中用的是JSONObject反序列化一个对象,但是当遇到时间类型的时候,其将会改为时间戳形式,所以我们需要在前台将时间戳转化下,具体的如下js所示

    $(function(){

           //这个#dataGrid一定要和以上table的id对应

               $('#dataGrid').datagrid({

                   title:'访问统计',

                   $(this).width() * 0.98,

                   height:$(this).height() * 0.9,

                   nowrap: false,

                   striped: true,
                   pagination:true,//分页控件        
                   rownumbers:true,
                   collapsible:false,

                   http://www.cnblogs.com/cmzcheng/admin/'%3Cs:url value="/countMsg/countMsg_queryOrder.action"/>',

                   remoteSort: true,

                   idField:'visitCode',

                   loadMsg:'装载中...',

                   columns:[[

                       {field:'visitUrl',title:'访问页面地址',300,align:'center'},

                       {field:'visitPageTitle',title:'访问页面名称',120,align:'center'},

                       {field:'visitDate',title:'访问时间',100,align:'center',
                           formatter:function(val,rec){
                         if (val){
                        var date = new Date(val.time);
                        var d = date.getFullYear()+'-'+(date.getMonth() + 1)+'-'+date.getDate();
    var t = date.getHours()+':'+date.getMinutes()+':'+date.getSeconds();
                        return d+"  "+t;
                        } else {
                                return '';
                           }
                   }
                
                       }
                   ]]
           });

        //其实上面就够了,下面纯属为了手动改dataGrid页脚下那些分页参数的label显示
       var p = $('#dataGrid').datagrid('getPager');     
        $(p).pagination({          
        pageSize: 10,//每页显示的记录条数,默认为10 
        pageList: [5,10,15],//可以设置每页记录条数的列表    
              beforePageText: '第',//页数文本框前显示的汉字          
              afterPageText: '页    共 {pages} 页',        
                displayMsg: '当前显示 {from} - {to} 条记录   共 {total} 条记录'       
                  /*onBeforeRefresh:function(){              $(this).pagination('loading');              alert('before refresh');              $(this).pagination('loaded');          }*/    
                   });
                   });
    </script>

  • 相关阅读:
    在CentOS7 安装 Redis数据库
    Gulp-构建工具 相关内容整理
    Mac中设置Sublime快速在终端中使用命令打开项目
    CentOS 7.6出现SSH登录失败的解决方法
    使用 Vagrant + VirtualBox 快速构建 CentOS 下的 Docker 环境
    平凡的世界
    EBR内容解析
    MBR内容解析
    使用vbs给PPT(包括公式)去背景
    Ubuntu 14.04 LTS 初装成
  • 原文地址:https://www.cnblogs.com/cmzcheng/p/2435368.html
Copyright © 2011-2022 走看看