【问题标题】:Date format for DateColum in extjs editor gridextjs 编辑器网格中 DateColum 的日期格式
【发布时间】:2013-12-31 03:14:07
【问题描述】:

我的编辑器网格的 DateColum 如下所示

MyColumn1Ui = Ext.extend(Ext.grid.DateColumn, {
    constructor: function(cfg) {
        cfg = cfg || {};
        MyColumn1Ui.superclass.constructor.call(this, Ext.apply({
            header: 'Date',
            sortable: true,
            width: 100,
            dataIndex: 'DATE',
            format: 'm-d-Y',
            css: ' width: 94px !important;',
            id: 'date_col',
            editor: {
                xtype: 'datefield',
                name: 'USG_DATE',
                format: 'm-d-Y',
                maxLength: 50,
                enableKeyEvents: true,
                id: 'date'
            }
        }, cfg));
    }
});

我需要日期为 mm-dd-yyyy 但我的网格 afteredit 方法将日期设置为波纹管格式 Wed Dec 25 2013 00:00:00 GMT+0530 (Sri Lanka Standard Time) 我怎样才能得到日期为 mm-dd-yyyy。

注意:由于更改日期格式网格单元格单击,事件我不会更改日期网格触发后编辑事件

【问题讨论】:

    标签: extjs extjs3


    【解决方案1】:

    请试试这个

    MyColumn1Ui = Ext.extend(Ext.grid.DateColumn, {
    constructor: function(cfg) {
        cfg = cfg || {};
        MyColumn1Ui.superclass.constructor.call(this, Ext.apply({
            header: 'Date',
            sortable: true,
            width: 100,
            xtype: 'datecolumn',
            format: 'm-d-Y',
            css: ' width: 94px !important;',
            id: 'date_col',
            editor: {
                xtype: 'datefield',
                name: 'USG_DATE',
                maxLength: 50,
                enableKeyEvents: true,
                id: 'date'
            }
        }, cfg));
    }
    

    });

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2023-03-14
      • 1970-01-01
      • 2015-03-28
      • 1970-01-01
      • 1970-01-01
      • 2014-02-04
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多