在date列$ className获取错误

我试图导出网格excel和使用出口商来实现它,而我的网格在这里小提琴

Ext.application({ name: 'Fiddle', launch: function () { Ext.create('Ext.data.Store', { storeId: 'simpsonsStore', fields: ['name', 'email', 'phone','date'], data: { 'items': [{ 'name': 'Arshad11111', "email": "kahdkha@abc.com", "phone": "6488646486", "date":"2016-03-23" }, { 'name': 'Aesadasdasd', "email": "asdsadasd@sdsc.com", "phone": "6488646486", "date":"2016-03-23" }, { 'name': 'gadjandna', "email": "asdjf@ndfnsdos.com", "phone": "6488646486", "date":"2016-03-23" }, { 'name': 'asdasdasd', "email": "asdasd@dfsdf.com", "phone": "555-222-1254", "date": "2016-03-23" }, ] }, proxy: { type: 'memory', reader: { type: 'json', root: 'items' } }, }); Ext.create('Ext.grid.Panel', { title: 'Simpsons', store: Ext.data.StoreManager.lookup('simpsonsStore'), columns: [{ text: 'Name', dataIndex: 'name' }, { text: 'Email', dataIndex: 'email', flex: 1 }, { text: 'Phone', dataIndex: 'phone' },{ text: 'Date', xtype: 'datecolumn', dataIndex: 'telecastdate', format: 'Ym-d', flex: 1 }], height: 300, width: 400, dockedItems: [{ xtype: 'toolbar', docked: 'bottom', items: [{ xtype: 'button', flex: 1, text: 'Download to Excel', handler: function (b, e) { b.up('grid').downloadExcelXml(); } }] } ], renderTo: Ext.getBody() }); } }); 

它有一个xtype作为date列的行,并在下面的网格行excel转换器,我得到这个Uncaught TypeError: Cannot read property '$className' of undefined错误的Uncaught TypeError: Cannot read property '$className' of undefined ,但是如果我删除该date列它完美的作品,所以如何我进行相同的更改,

 switch (fld.$className) { case "Ext.data.field.Integer": console.log('Here Im typing 11111' + fld.$className); cellType.push("Number"); cellTypeClass.push("int"); break; case "Ext.data.field.Number": console.log('Here Im typing 2222' + fld.$className); cellType.push("Number"); cellTypeClass.push("float"); break; case "Ext.data.field.Boolean": console.log('Here Im typing 33333' + fld.$className); cellType.push("String"); cellTypeClass.push(""); break; case "Ext.data.field.Date": console.log('Here Im typing 4444' + fld.$className); cellType.push("DateTime"); cellTypeClass.push("date"); break; default: console.log('Here Im typing 555555555' + fld.$className); cellType.push("String"); cellTypeClass.push(""); break; } } 

提前致谢

date列中存在错误的dataIndex。 您定义的商店没有字段telecastdatedate 。 当你改变telecastdate date它就起作用了。

看到小提琴 。