1

I'm using a TreeGrid to display some data. Since I implemented the treegrid, extjs keeps throwing this error:

Store defined with no model. You may have mistyped the model name.

I debugged a bit and found out, that this is thrown because there is a "nodeStore" without model.

Where does this "nodeStore" come from and what am I doing wrong?

Store:

Ext.define('AM.store.AdvertiserStatistics', {
    extend: 'Ext.data.TreeStore',
    model: 'AM.model.AdvertiserStatistic',
    autoLoad: false,
    folderSort: true,
    startDate: new Date().getTime(),
    endDate: new Date().getTime(),
    nodeType: 'weekly',
    parentId: null,
    [..]

Model:

Ext.define('AM.model.AdvertiserStatistic', {
    extend: 'Ext.data.Model',
fields: [
    {
        name:'id',
        type:'int',
        useNull:true
    },
    'email',
    'clientname',
],
proxy:{
    type:'ajax',
    reader:{
        type:'json',
    root:'data'
    },
    api:{
    read:BASE_PATH + 'advertisers/index/stats:true/',
    destroy: BASE_PATH + 'advertisers/index/stats:true/'
    },
    base_api: {}
}
});
Gray
  • 7,050
  • 2
  • 29
  • 52
Julian Hollmann
  • 2,902
  • 2
  • 25
  • 44

2 Answers2

0

The only guess I have - is that you forgot to add your model into the models collection of you MVC app. You could also try to set require property in your store. Just put the same string as for the model property.

Ext.define('AM.store.AdvertiserStatistics', {
    extend: 'Ext.data.TreeStore',
    model: 'AM.model.AdvertiserStatistic',
    require: 'AM.model.AdvertiserStatistic', //this!
    autoLoad: false,
    folderSort: true,
    startDate: new Date().getTime(),
    endDate: new Date().getTime(),
    nodeType: 'weekly',
    parentId: null,
    [..]
Andrey Selitsky
  • 2,584
  • 3
  • 28
  • 42
0

I've answered this elsewhere, but I think this question will be easier to find for people who do the debugging as you have:

This is a bug in NodeStore. You will always see this when you use a Tree Panel.

David Kanarek
  • 12,611
  • 5
  • 45
  • 62
  • I'm not sure if there's one or not. You could check on the Ext forums. I've largely ignored the issue as it's not actually harmful. – David Kanarek Feb 24 '12 at 17:25