码迷,mamicode.com
首页 > 其他好文 > 详细

easyUI中 datagrid 格式化日期

时间:2016-12-06 09:19:52      阅读:322      评论:0      收藏:0      [点我收藏+]

标签:var   log   tco   eth   ble   mat   desc   video   格式   

 $(‘#List‘).datagrid({
            url: ‘@Url.Action("GetList")‘,
            width:SetGridWidthSub(10),
            methord: ‘post‘,
            height: SetGridHeightSub(45),
            fitColumns: true,
            sortName: ‘CreateTime‘,
            sortOrder: ‘desc‘,
            idField: ‘Id‘,
            pageSize: 15,
            pageList: [15, 20, 30, 40, 50],
            pagination: true,
            striped: true, //奇偶行是否区分
            singleSelect: true,//单选模式
            //rownumbers: true,//行号
            columns: [[
                { field: ‘Id‘, title: ‘编号‘, width: 80,hidden:true },
                
                { field: ‘Tname‘, title: ‘名称‘, width: 80,sortable:true },
                { field: ‘VideoClassifyId‘, title: ‘父编号‘, width: 80, hidden: true },
                {
                    field: ‘CreateTime‘, title: ‘创建时间‘, width: 80, sortable: true,
                    formatter : function(value){
                        var date = new Date(value);
                        var y = date.getFullYear();
                        var m = date.getMonth() + 1;
                        var d = date.getDate();
                        return y + ‘-‘ +m + ‘-‘ + d;
                    }

                },
                { field: ‘VideoClassifyName‘, title: ‘上级目录‘, width: 80, hidden: true }, // by zyh
                { field: ‘Remark‘, title: ‘备注‘, width: 80,sortable:true }
                
            ]]
        });

 

easyUI中 datagrid 格式化日期

标签:var   log   tco   eth   ble   mat   desc   video   格式   

原文地址:http://www.cnblogs.com/zyh1994/p/6136197.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!