Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/excel/26.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/date/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Excel 获取日期列$className处的错误_Excel_Date_Extjs_Combobox - Fatal编程技术网

Excel 获取日期列$className处的错误

Excel 获取日期列$className处的错误,excel,date,extjs,combobox,Excel,Date,Extjs,Combobox,我正在尝试导出网格excel并使用, 我的网格在这里 网格 Ext.application({ name: 'Fiddle', launch: function () { Ext.create('Ext.data.Store', { storeId: 'simpsonsStore', fields: ['name', 'email', 'phone','date'], data: {

我正在尝试导出网格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: 'Y-m-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作为datecolumn,在下面的网格到excel转换器的行中,我得到了这个
未捕获的TypeError:无法读取未定义的属性“$className”
错误,但是如果我删除了这个datecolumn,它就工作得很好,所以我如何对它进行更改

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;
                    }
                }

提前感谢

日期列中有一个错误的
数据索引
。 您定义的存储没有字段
telecoast date
,而是
date
。 当您将
telecoast date
更改为
date
时,它会起作用


查看运行状态。

完全正确。或者换一种方式。将
电视广播日期
放入存储。例如:
{'name':'asdasdasd',“email”:asdasd@dfsdf.com“,”电话“:”555-222-1254“,”电视广播日期“:”2016-03-23”}
我匆忙错过了。感谢您的帮助,还有@UDID