新しいExtJSのリリースは、あなたのクロムを不安定にする可能性があります(それとも私のコードですか)!私の状況を説明しましょう。ExtJS 4.0 MVCアプリケーションのTreeStoreに関する問題
私はExtJS 4.0の新しいMVCアーキテクチャに取り組んでいます。私はアプリケーションパネルまたはナビゲーションを表示するツリーパネルを持っています。アーキテクチャごとに、ツリーパネルをコントローラ、ビュー、および別のストアに分割しようとしました。
Ext.define('CRM.view.menu.View', {
alias: 'widget.menutree',
extend: 'Ext.tree.Panel',
initComponent: function() {
console.log('initComponent of View...');
Ext.apply(this, {
title: 'Simple Tree',
width: 200,
store: 'MainMenu',
rootVisible: false
});
this.callParent(arguments);
}
});
マイツリーのストア:
は、ここに私の見解である
Ext.define('CRM.store.MainMenu', {
extend: 'Ext.data.TreeStore',
constructor: function() {
console.log('Constructor of MainMenu TreeStore');
config = Ext.apply(this,{
proxy: {
type: 'ajax',
url: 'data/menu.json'
},root: {
text: 'Menu',
id: 'src',
expanded: true
}
});
this.callParent(arguments);
}
});
そして、私のコントローラで私も私の店の情報を提供してきました。ここに私のコントローラの設定の一部です:最初の実行で
Ext.define('CRM.controller.MainMenu',{
extend: 'Ext.app.Controller',
stores: ['MainMenu'],
refs: [
{ref:'menu',selector: 'menutree'},
{ref:'cp',selector: 'centerpane'}
],
.
.
.
、私は次のエラーを取得:
Object MainMenu has no method 'getRootNode'
しかし、今、私はより多くの奇妙なエラーが出ます:クロームに実行を停止することを お知らせツリーストアのコンストラクタです。
同時に、Firefoxで: Firefoxはうまく実行されますが、レンダリングされたアプリケーションはありません!今
Ext.define('CRM.view.menu.View', {
alias: 'widget.menutree',
extend: 'Ext.tree.Panel',
initComponent: function() {
console.log('initComponent of View...');
Ext.apply(this, {
title: 'Simple Tree',
width: 200,
store: {
proxy: {
type: 'ajax',
url: 'data/menu.json'
},root: {
text: 'Menu',
id: 'src',
expanded: true
}
},
rootVisible: false
});
this.callParent(arguments);
}
});
:
いくつかの試行錯誤が..私は..実行している私のアプリケーションを取得する方法を見つけた、それが私の店を使用して回避し、直接、以下のように店舗情報を提供することです後アプリケーションは全く問題なく実行されます。
誰かがMVCアーキテクチャを使用してツリーパネルを作成しようとしましたか?私はこれを修正する方法の手掛かりがありません!