Extjs 同步加载';MyApp.store.treeststructures';;考虑添加ExtExtRead(和x x27;MyApp.Stury.TeeSealths&x x27;)

Extjs 同步加载';MyApp.store.treeststructures';;考虑添加ExtExtRead(和x x27;MyApp.Stury.TeeSealths&x x27;),extjs,extjs-mvc,sencha-cmd,ext-direct,Extjs,Extjs Mvc,Sencha Cmd,Ext Direct,下面,您将看到我在Sencha ExtJS MVC应用程序中创建的MVC视图出现JavaScript异常。我有另一个MVC视图,它扩展了“Ext.tree.Panel”,它读取一个简单的JSON对象,而不是通过Ext.Direct代理和.NET服务器端堆栈提取数据,但唯一不同的是代理实现,当然还有我们的MVC控制器逻辑。在静态(JSON)实现中,我们的代理在模型中定义。在动态(Ext.Direct)实现中,我们的代理在存储中定义。TreeStructures.js(store)JavaScrip

下面,您将看到我在Sencha ExtJS MVC应用程序中创建的MVC视图出现JavaScript异常。我有另一个MVC视图,它扩展了“Ext.tree.Panel”,它读取一个简单的JSON对象,而不是通过Ext.Direct代理和.NET服务器端堆栈提取数据,但唯一不同的是代理实现,当然还有我们的MVC控制器逻辑。在静态(JSON)实现中,我们的代理在模型中定义。在动态(Ext.Direct)实现中,我们的代理在存储中定义。TreeStructures.js(store)JavaScript文件不断被请求无数次,直到浏览器崩溃。请参见下面的例外情况

我非常怀疑这是一个Ext.Direct问题,因为我有其他商店使用这种架构非常好。我看到[Ext.Loader]异常,但我不确定为什么每次新的treeststructures.js请求都会重复这个异常。或者在何处实施这一要求。我的理解是app.js定义了控制器。然后,控制器定义存储的模型。视口定义并实例化其他MVC视图。我的“其他视图”是树视图。视图实现了存储

此外,Sencha Cmd“Sencha app build”命令不起作用。通常情况下,我的应用程序编译时不会出现任何问题,因此存储区或MVC配置中肯定缺少此动态树所必需的内容

JavaScript控制台中的异常: 浏览器崩溃,出现此JavaScript异常: 注意:TreeStructures.js(store)JavaScript文件不断被请求无数次,直到浏览器崩溃:

Sencha Cmd错误(调用“Sencha app build”命令后): 动态树实现(使用服务器端堆栈获取数据):
Ext.create('MyApp.store.treeststructures'{
扩展:“Ext.data.TreeStore”,
模型:“MyApp.model.treeststructure”,
代理:{
类型:'直接',
directFn:Concept_Tree_Structure.read,
读者:{
root:“数据”
}
},
根目录:{
文本:“概念树”,
id:'根',
扩展:false
//儿童:[]
},
自动加载:错误
});
Ext.define('MyApp.model.treeststructure'{
扩展:“Ext.data.Model”,
xtype:'模型树结构',
字段:[
{name:'text'},//字符串
{name:'id'},//Int32类型:'int'
{name:'expanded'},//布尔值
{name:'leaf'},//布尔值
{name:'children'}//List
]
});
Ext.define('MyApp.controller.ConceptTreeController'{
扩展:“Ext.app.Controller”,
存储:[“树结构”、“概念”],
模型:[“树状结构”、“概念”],
参考文献:[{
参考:“概念树”,
选择器:“查看概念树”
}],
init:function(){
此.getConceptsStore().load({
参数:{
起点:0,
限额:10,
福:“酒吧”
}
});
此.GettreesStructuresStore()加载({
参数:{
起点:0,
限额:10,
福:“酒吧”
}
});
}
});
更改Ext.create('MyApp.store.treeststructures')

到Ext.define('MyApp.store.treeststructures')…

更改Ext.create('MyApp.store.treeststructures')


定义('MyApp.store.treeststructures'…

看起来很像它,因为你在你的treeststructures商店上做的是Ext.create而不是Ext.define。请随便回答。你是个救命稻草。我想我只需要睡一会儿!这是另一个专门处理动态文件包含的库。它与ExtJS exc无关基本概念的ept。看起来像是,因为您在树结构存储上执行的是Ext.create而不是Ext.define。请随意回答。您是个救生员。我想我只需要睡一会儿!作为记录,这是另一个专门处理动态文件包含的库。它与ExtJS无关,除了对于基本概念。
[Ext.Loader] Synchronously loading 'MyApp.store.TreeStructures'; consider adding Ext.require('MyApp.store.TreeStructures') above Ext.onReady
Uncaught RangeError: Maximum call stack size exceeded
[ERR] failed to find meta class definition for name MyApp.store.TreeStructures
[ERR] def was null
[ERR] C2008: Requirement had no matching files <MyApp.store.TreeStructures> -- unknown-file:-1
Ext.define('MyApp.store.Categories', {
    extend : 'Ext.data.TreeStore',
    model : 'MyApp.model.Category',
    autoLoad : true,
    root : {
        text : 'All',
        alias : '',
        expanded : true
    }
});

Ext.define('MyApp.model.Category', {
    extend: 'Ext.data.Model',
    fields: [
        { name: 'alias', type: 'auto' },
        { name: 'text', type: 'auto' }
    ],

    proxy: {
        type: 'ajax',
        url: 'data/categories.json'
    }
});

Ext.define('MyApp.controller.ConceptTreeReadonly', {
    extend : 'Ext.app.Controller',
    stores: ['Categories'],
    models: ['Category'],
    refs : [{
        ref: 'categories',
        selector: 'view-west'
    }],
});
Ext.create('MyApp.store.TreeStructures', {
    extend: 'Ext.data.TreeStore',
    model : 'MyApp.model.TreeStructure',
    proxy: {
        type: 'direct',
        directFn: Concept_Tree_Structure.read,
        reader: {
            root: 'data'
        }
    },
    root: {
        text: 'Concept Tree',
        id: 'root',
        expanded: false
        //children: []
    },
    autoLoad: false
});

Ext.define('MyApp.model.TreeStructure', {
    extend: 'Ext.data.Model',
    xtype: 'model-tree-structure',

    fields: [
        { name: 'text' }, //  string                    
        { name: 'id' }, // Int32    type: 'int'
        { name: 'expanded' }, // boolean                   
        { name: 'leaf' }, // boolean       
        { name: 'children' } // List<TreeStructure>            
    ]
});

Ext.define('MyApp.controller.ConceptTreeController', {
    extend : 'Ext.app.Controller',

    stores: ['TreeStructures', 'Concepts'],
    models: ['TreeStructure', 'Concept'],

    refs : [{
        ref: 'concept-tree',
        selector: 'view-concept-tree'
    }],
    init : function() {

        this.getConceptsStore().load({
            params: {
                start: 0, 
                limit: 10,
                foo: 'bar'
            }
        });

        this.getTreeStructuresStore().load({
            params: {
                start: 0,
                limit: 10,
                foo: 'bar'
            }
        });
    }
});