未捕获的TypeError:无法读取null的属性“data”

时间:2013-02-13 13:13:28

标签: extjs4.1

我正在尝试使用ajax代理从json文件中读取数据。但是我收到此错误无法读取null的属性'data'。可以告诉有什么问题如何修复它

Uncaught TypeError: Cannot read property 'data' of null ext/src/chart/axis/Axis.js:155
Ext.define.getRange ext/src/chart/axis/Axis.js:155
Ext.define.calcEnds ext/src/chart/axis/Axis.js:319
Ext.define.applyData ext/src/chart/axis/Numeric.js:232
Ext.define.drawAxis ext/src/chart/axis/Axis.js:372
Ext.define.redraw ext/src/chart/Chart.js:477
Ext.define.afterComponentLayout ext/src/chart/Chart.js:436
Ext.define.notifyOwner Component.js:170
Ext.define.callLayout Context.js:349
Ext.define.flushLayouts Context.js:520
Ext.define.runComplete Context.js:1096
callOverrideParent ext-dev.js:56
Base.implement.callParent ext-dev.js:6271
Ext.override.runComplete AbstractComponent.js:80
Ext.define.run Context.js:1077
Ext.define.statics.flushLayouts AbstractComponent.js:84
Ext.define.statics.resumeLayouts AbstractComponent.js:100
Ext.resumeLayouts AbstractComponent.js:3437
Ext.define.render Renderable.js:809
Ext.define.constructor AbstractComponent.js:1126
Base.implement.callParent ext-dev.js:6271
Ext.define.constructor Component.js:336
constructor ext-dev.js:7459
(anonymous function)
Ext.ClassManager.instantiate ext-dev.js:8199
(anonymous function) ext-dev.js:3015
Ext.application.launch app.js:14
Ext.define.onBeforeLaunch Application.js:208
(anonymous function) Application.js:174
(anonymous function) ext-dev.js:14498
fire ext-dev.js:14658
Ext.apply.readyEvent.event.fire ext-dev.js:14901
Ext.apply.fireReadyEvent ext-dev.js:14999
Ext.apply.onDocumentReady ext-dev.js:15023
Ext.apply.onReady.fn ext-dev.js:10056
Ext.apply.triggerReady ext-dev.js:10042
Ext.apply.refreshQueue ext-dev.js:9540
Ext.apply.refreshQueue ext-dev.js:9541
Ext.apply.refreshQueue ext-dev.js:9541
Ext.apply.onFileLoaded ext-dev.js:9947
(anonymous function) ext-dev.js:3001
Ext.apply.injectScriptElement.onLoadFn

这是我的商店代码

Ext.define('extcityview.store.Barchart', {
    extend:'Ext.data.Store',
    storeId : 'barchart',
    model : 'extcityview.model.Barchart',
    autoLoad : 'true',
    proxy : {
        type : 'ajax',
        url : 'information.json',
        reader : {
            type : 'json',
            rootProperty : 'data'
        }
    }
});

Json回复

{
data : [{
        'name' : 'metric one',
        'data' :10,
        'data1' :20,
        'data2' :15
    }, {
        'name' : 'metric two',
        'data' : 7,
        'data1' : 30,
        'data2':10
    }, {
        'name' : 'metric three',
        'data' : 5,
        'data1': 25,
        'data2':15
    }, {
        'name' : 'metric four',
        'data' : 2,
        'data1' : 26,
        'data2':20
    }, {
        'name' : 'metric five',
        'data' : 27,
        'data1': 27,
        'data2':15
    }, {
        'name' : 'metric six',
        'data' : 15,
        'data1' : 10,
        'data2':8
    }]

 }

由于

0 个答案:

没有答案