Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/extjs/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Extjs 网格中的数据绘制_Extjs - Fatal编程技术网

Extjs 网格中的数据绘制

Extjs 网格中的数据绘制,extjs,Extjs,我正在使用ExtJs开发一个应用程序,我遇到了一个问题。我有一个网格,它有两列(日期1,日期2),但是当我插入数据时,日期1和日期2会在网格中自动正常显示,但当我刷新页面时,所有日期都会显示:“31/12/1969”,时间戳返回正确(1346284800000),有人能提供见解吗 { header: 'Date 1', dataIndex: 'date1', flex : 0.3, renderer : function(value, cell, model, i

我正在使用ExtJs开发一个应用程序,我遇到了一个问题。我有一个网格,它有两列(日期1,日期2),但是当我插入数据时,日期1和日期2会在网格中自动正常显示,但当我刷新页面时,所有日期都会显示:“31/12/1969”,时间戳返回正确(1346284800000),有人能提供见解吗

{
    header: 'Date 1',
    dataIndex: 'date1',
    flex : 0.3,
    renderer : function(value, cell, model, index) {
        data = new Date();
        data.setTime(value); 
        return Ext.util.Format.date(data, 'd/m/Y');
    }
}, {
    header: 'Date 2',
    dataIndex: 'date2',
    flex : 0.3,
    renderer : function(value, cell, model, index) {
        data = new Date();
        data.setTime(value);
        return Ext.util.Format.date(data, 'd/m/Y');
    }
}, 

如果我正确理解了您的问题,那么您正在尝试在网格中显示Unix时间戳。请尝试此渲染器:

renderer: function(value) {
    var date = Ext.Date.parse(value, 'U');

    return Ext.Date.format(date, 'd/m/Y');
}

“renderer”函数中的“value”为空,但在我的响应服务器中,它是时间戳,我不知道发生了什么。很可能这意味着您错误配置了模型。或者根本没有配置它,更有可能。请发布您的店铺配置。