0

I'm working on small json example and I'm getting the error

[WARN][Ext.dataview.NestedList#applyStore] The specified Store cannot be found "

when i try to access store from nested list

> here is the code for Store

    Ext.define('kids.store.vids',{
    extend: 'Ext.data.Model',
    xtype: 'vids',
    config: {
        type: 'tree',
        fields: ['id' , 'title' ],
        root: { leaf: false },
        proxy:{
            type: 'ajax',
            url: 'resources/jsonfile/jsonfile.json',
            reader: {
                type: 'json',
                rootProperty: 'items.feed.Lang.Type'
            }
        },
        autoLoad: true
    }
});

**

View

Ext.define('kids.view.VidList',{
    extend: 'Ext.Container',
    xtype: 'vidlist',
    fullscreen: true,
    requires: [
        'Ext.NestedList',
        'Ext.tab.Panel',
        'Ext.data.*',
        'kids.store.vids',
        'Ext.data.TreeStore',
        'Ext.dataview.NestedList',
    ],
    config: {
        items: [
            {
                xtype: 'nestedlist',
                title: 'video list from model vids',
                displayField: 'title',
                layout: 'vbox',
                store: 'vids',
            }
        ]
    }
});

Am i doing anything wrong here?

I've added stores, views in app.js

4

1 回答 1

1

When declaring your store, use storeId instead of xtype to identify the store:

Ext.define('kids.store.vids',{
    extend: 'Ext.data.Model',
    config: {
        storeId: 'vids', // use this as the value of the 'store' property in your list
        type: 'tree',
        fields: ['id' , 'title' ],
        root: { leaf: false },
        proxy:{
            type: 'ajax',
            url: 'resources/jsonfile/jsonfile.json',
            reader: {
                type: 'json',
                rootProperty: 'items.feed.Lang.Type'
            }
        },
        autoLoad: true
    }
});
于 2013-02-16T16:34:06.583 回答