3
votes

In the code below, I can't get birthdate field in grid panel,

var store = new Ext.data.SimpleStore({
    fields:[
       'name',
       'phone',
       'email',
       {name:'birthday', **type:'date', dateFormat:'m/d/y'**}
       ]
});

 var myData = [
               ['Meyers, Quyn R.', '(943) 570-5141', '[email protected]', '05/13/1990'],
               ['Whitney, Tad T.', '(547) 743-0343', '[email protected]', '05/10/1987'],
              ];

store.loadData(myData);

var grid = new Ext.grid.GridPanel({
    store:store,
    columns:[{header:'NAME', width:170 , sortable:true, dataIntex:'name'},
             {header:'PHONE NO', width:150 , sortable:true, dataIntex:'phone'}, 
             {header:'EMAIL ', width:150 , sortable:true, dataIntex:'email'},
             {header:'BirthDate ', width:100 , sortable:true, dataIntex:'birthday',**renderer: Ext.util.Format.dateRenderer('d/m/Y')** }
             ],
    title:'My Contacts',
    autoHeight:true,
    width:590,
    //renderTo:document.body(),
    fram:true
}); 
1

1 Answers

3
votes

You have the wrong dateFormat in your birthday Field config. Should be:

{ name : 'birthday', type : 'date', dateFormat : 'm/d/Y' }

Hope this help.