简体   繁体   中英

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"
      }]

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: 'dm-Y' .

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM