0

stackoverflow 论坛成员我需要你的帮助。

我以 json 格式获取 startDate 的服务器响应 "startDate":1328466599000

我想将它显示到我的 ExtJs 列。但我无法显示它。

我在其中显示 StartDate 的列是 [Ext.Date.format(values.StartDate, "c")] ,我的 TaskModel 是

Ext.define("TaskModel", {
        extend : "Gnt.model.Task",

        // Some custom field definitions
        fields : [
            { name: 'Id', type: 'int', useNull : true, mapping: 'id'},
            { name: 'StartDate', type: 'date', mapping: 'startDate'},
            { name: 'EndDate', type: 'date', mapping: 'endDate', dateFormat: 'MS'},
            { name: 'Priority', defaultValue : 1, mapping: 'priority', dateFormat: 'MS' },
            { name: 'Duration', mapping: 'duration'},
             { name: 'PercentDone', mapping: 'percentDone'},
             { name: 'DurationUnit', mapping: 'durationUnit'},
             { name: 'parentId', mapping: 'parentId', type: 'int'},
             { name: 'Name', mapping: 'taskName'},
             { name: 'index', mapping: 'taskindex'},
             { name: 'depth', mapping: 'depth'},
        ]
    });

我无法查看我收到的作为对我的专栏的回复的 startDate。

有谁知道是什么导致了这个错误?如果有人有解决此问题的方法,请帮助我。

4

2 回答 2

1

可能是您在 priority 列上定义了 dateformat,而不是 startdate 列?

于 2012-01-17T10:39:02.693 回答
0

我在这里写了一篇博文:http: //peterkellner.net/2011/08/24/getting-extjs-4-date-format-to-behave-properly-in-grid-panel-with-asp-net-mvc3 /

很抱歉不久前挖掘了一些东西,但我只是在寻找同样的东西并首先进入我的博客文章(在这个项目之前)

于 2012-11-29T20:44:08.320 回答