@{
ViewBag.Title = "Home Page";
Layout = null;
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Page Title</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="https://www.jeasyui.com/easyui/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="https://www.jeasyui.com/easyui/themes/icon.css">
<script type="text/javascript" src="http://libs.baidu.com/jquery/1.10.2/jquery.min.js"></script>
<script type="text/javascript" src="https://www.jeasyui.com/easyui/jquery.easyui.min.js"></script>
</head>
<body>
<table id="List" class="easyui-datagrid" style="width: auto; height: 350px;"></table> <script>
$(function () { $('#List').datagrid({
url: '@Url.Action("GetList")',
method: 'post',
fitColumns: true,
sortName: 'id',
sortOrder: 'asc',
idField: true,
striped: true,
singleSelect: true,
rownumbers: true,
columns: [[
{ field: 'id', title: 'ID', width: , align: 'center' },
{ field: 'email', title: '注册邮箱', width: , align: 'center' },
{ field: 'pwd', title: '密码', width: , align: 'center' },
{ field: 'time', title: '登录时间', width: , align: 'center', formatter: formatDate } ]]
});
});
function PrefixInteger(num, length) {
return (Array(length).join('') + num).slice(-length);
}
function formatDate(NewDtime) {
if (NewDtime == null || NewDtime == "")
return;
var dt = new Date(parseInt(NewDtime.slice(, )));
var year = dt.getFullYear();
var month = PrefixInteger(dt.getMonth() + ,);
var date = PrefixInteger(dt.getDate(),);
var hour = PrefixInteger(dt.getHours(),);
var minute = PrefixInteger(dt.getMinutes(),);
var second = PrefixInteger(dt.getSeconds(), );
return year + "-" + month + "-" + date + " " + hour + ":" + minute + ":" + second;
}
</script>
</body> </html>
    public JsonResult GetList()
{
var user = new List<User>
{
new User {id= ,email="123@qq.com",pwd="",time=DateTime.Now },
new User {id= ,email="123@qq.com",pwd="",time=null }
};
return Json(user, JsonRequestBehavior.AllowGet);
}

EasyUI datagrid 序列 化后时间 处理 九的更多相关文章

  1. easyui datagrid 中序列化后的日期格式化

    1.在easyui datagrid 中序列化后的日期显示为:/Date(1433377800000)/ 2.格式化后的显示为: 2015-06-04 08:30:00 3.使用代码如下: 3.1. ...

  2. jquery easyui datagrid翻页后再查询始终从第一页开始

    在查询之前将datagrid的属性pageNumber重新设置为1 var opts = grid.datagrid('options'); opts.pageNumber = 1; easyui d ...

  3. easyUi DataGrid 显示日期列,时间为空也可,的正常显示,及普通居中列情况

    $('#tt').datagrid({                url: '@Url.Content("~/kpi/FindList")',                w ...

  4. EasyUI datagrid 日期时间格式化

    EasyUI datagrid中显示日期时间时,会显示为以下不太直观的数值: 添加以下JavaScript脚本,然后在field中添加 formatter: DateTimeFormatter 即可. ...

  5. 解决easyui datagrid load时缓存问题

    修改easyui datagrid内容保存后,使用$("#dg").datagrid("reload");或者$("#dg").datagr ...

  6. [转载]easyui datagrid 时间格化(JS 日期时间本地化显示)

    easyui datagrid 日期时间显示不正常,后台java 类型为 DATE 经过JSON工具一转化传到前台来就是这样,不便 于是想格式化一下, 格式化代码 如下: [javascript] v ...

  7. easyui datagrid 每条数据后添加操作按钮

    easyui datagrid 每条数据后添加“编辑.查看.删除”按钮 1.给datagrid添加操作字段:字段值 <table class="easyui-datagrid" ...

  8. 关于EasyUI DataGrid行编辑时嵌入时间控件

    本人做一个名为“安徽中控”项目时,为快速开发基础数据增删改模块,遂采用EasyUIDatagrid将所有增删改查的操作都集中于表格中,并且所有增删改查操作都集中于泛型对象,从而不必为每个表写具体的增删 ...

  9. EasyUI Datagrid Datetime(EasyUI DataGrid 时间格式化)

    EasyUI DataGrid 时间格式化 方法一: var Common = { //EasyUI用DataGrid用日期格式化 TimeFormatter: function (value, re ...

随机推荐

  1. POJ3090 Visible Lattice Points

    /* * POJ3090 Visible Lattice Points * 欧拉函数 */ #include<cstdio> using namespace std; int C,N; / ...

  2. Eclipse的Outline功能栏调出来

    window-->Shoe View -->Outline 按住鼠标左键拖一下Outline功能栏,就可以无论开哪个项目都能够在右边显示Outline功能栏 转载地址:https://bl ...

  3. 第 8 章 容器网络 - 067 - 如何部署 Calico 网络?

    0.准备工作 Calico 是一个纯三层的虚拟网络方案,Calico 为每个容器分配一个 IP,每个 host 都是 router,把不同 host 的容器连接起来. 与 VxLAN 不同的是,Cal ...

  4. 《SQL 基础教程》第二章:查询基础

    这一章的结构如下: SELECT 语句基础 算术运算符和比较运算符 逻辑运算符 SELECT 语句可用于查询数据,并且可以设定条件来查询具有特定值的记录.条件的设定就需要算数运算符.比较运算符和逻辑运 ...

  5. SQLLITE HELPER

    using System;using System.Data.SQLite; namespace SQLiteSamples{    class Program    {        //数据库连接 ...

  6. Lab 9-1

    Analyze the malware found in the file Lab09-01.exe using OllyDbg and IDA Pro to answer the following ...

  7. Swapping Characters CodeForces - 903E (字符串模拟)

    大意: 给定k个字符串, 长度均为n, 求是否存在一个串S, 使得k个字符串都可以由S恰好交换两个字符得到. 暴力枚举交换的两个字符的位置, 计算出交换后与其他串不同字符的个数, 若为1或>2显 ...

  8. 若依项目利用nginx实现负载均衡及保持会话

    记录一下若依项目利用nginx实现负载均衡及保持会话的步骤. 此次作为试验性的测试,为了方便在本地window的环境上实现. 具体步骤: 1.安装两个tomcat8,可以下载一个后,另一个复制即可,下 ...

  9. 蓝桥杯 每周一练 第一周(3n+1问题)

    [问题描述] 考虑如下的序列生成算法:从整数 n 开始,如果 n 是偶数,把它除以 2:如果 n 是奇数,把它乘 3 加1. 用新得到的值重复上述步骤,直到 n = 1 时停止.例如,n = 22 时 ...

  10. L330 Black hole picture captured for first time in space ‘breakthrough’

    Black hole picture captured for first time in space ‘breakthrough’ Astronomers have captured the fir ...