SexyMF
SexyMF

Reputation: 11155

Extjs grid date column wont display value

I have a simple grid and below is the basic config.
The grid wont show the date, its empty.
Have any idea y?
This is the json value returning fro, the server:
"StartAt":"\/Date(-62135596800000)\/"
Thanks

 {
       model: Ext.define(Ext.id(), {
        extend: "Ext.data.Model",
        fields: [ {
           name: "StartAt",
           type: "date",
           dateFormat: "d-m-Y"
         }]
     }

.....

columns: {
      items: [{
        id: "StartAt",
        xtype: "datecolumn",
        flex: 1,
        dataIndex: "StartAt",
        text: "Offer Start At"
      }]

Upvotes: 0

Views: 1186

Answers (2)

fivedogit
fivedogit

Reputation: 8524

In ExtJS 5, dateFormat: 'time' worked for me. dateFormat: 'ms' did not.

Upvotes: 0

Evan Trimboli
Evan Trimboli

Reputation: 30082

The dateFormat you specified in the model doesn't match what is coming back from the server. The point of specifying it on the model is so it knows how to parse the string that comes from the server. You want: dateFormat: 'MS'. On the column, you want to configure: format: 'd-m-Y'.

Upvotes: 2

Related Questions