首页 JQuery/JavaScript ExtJS3.3 格式化Grid日期列

ExtJS3.3 格式化Grid日期列

作者:胡同里的砖头 围观群众:1147 更新于:2013-12-19

//构建列
var cm = new Ext.grid.ColumnModel({
    // specify any defaults for each column
    defaults: {
        sortable: true ,
        menuDisabled: true
    },
    columns: [{
        id: 'ID',
        header: 'ID',
        dataIndex: 'ID',
        width: 220,
        hidden:true
    }, {
        id: "IsDeleted",
        dataIndex:"IsDeleted",
        hidden:true
    },{
        id: "Title",
        header: '标题',
        dataIndex: 'Title',
        width: 130
    }, {
        id: "Priority",
        header: '优先级',
        dataIndex: 'Priority',
        width: 70
    }, {
        id: "Content",
        header: '内容',
        dataIndex: 'Content',
        width: 70
    }, {
        id: "PublishDate",
        header: '发布时间',
        dataIndex: 'PublishDate',
        width: 70,
        renderer: function(value) {
            //return value;
            //alert(value);
            if (value != undefined) {
                var d = ConvertJSONDateToJSDateObject(value);
                if (d == null) {
                    d = value;
                }
                //alert(d);
                return d.dateFormat("Y-m-d");
            }
        },
        format: "Y-m-d",
        editor: new fm.DateField({
            allowBlank: false,
            format: "Y-m-d"
        })
    }]

});

  • 本文标题: ExtJS3.3 格式化Grid日期列
  • 文章分类:【JQuery/JavaScript】
  • 非特殊说明,本文版权归【胡同里的砖头】个人博客 所有,转载请注明出处.
留言评论
站点声明:
1、本站【胡同里的砖头】个人博客,借鉴网上一些博客模板,取其各优点模块自行拼装开发,本博客开发纯属个人爱好。
2、所有笔记提供给广大用户交流使用,可转载,可复制,纯个人开发所遇问题锦集记录使用
Copyright © huzlblog.com All Rights Reserved. 备案号:苏ICP备2021056683号-8