extjs4 - Strange failures in ExtJS MVC -



extjs4 - Strange failures in ExtJS MVC -

using extjs v4.1 mvc, have application class includes next code:

ext.application({ name: 'shop', appfolder: 'shop', ...

and main viewport has next code , items:

requires: ['shop.view.categorykey'], requires: ['shop.view.productlister'], ... layout: { type: 'border', padding: 3 }, items: [{ region: 'west', title: 'test1', xtype: 'categorykey' },{ region: 'center', title: 'test2', border: false }]

note viewport not using productlister object (yet. please bear me).

for completeness, below code productlister. note basic stuff intended set view application.

ext.define('shop.view.productlister', { extend: 'ext.view.view', alias: 'widget.productimages', title: 'list test' });

i seeing 2 weird things. first, when set requires statement in order shown above, when effort display page next failure (running using debug):

typeerror: name undefined

but if alter order of requires statements, looks below:

requires: ['shop.view.productlister'], requires: ['shop.view.categorykey'],

the error goes away!

the sec weird thing seeing when alter item list center has productlister:

layout: { type: 'border', padding: 3 }, items: [{ region: 'west', title: 'test1', xtype: 'categorykey' },{ region: 'center', xtype: 'productimages' }]

i same failure:

typeerror: name undefined

i monitored loading of files , noticed in cases productlister.js file never loaded!

a few other facts:

the mvc application has standard set of directories, root "shop" (hence appfolder property in application). both categorykey , productlister class in view subfolder.

i have controller lists both view classes (i want set event handling between them in controller):

config: { stores: ['categories'], views: ['categorykey','productlister'] },

in theory, between requires statements , configuration in controller, both views should loaded. reason, extjs loader seems loading categorykey.js file not productlister.js file.

furthermore, assume order of requires statements shouldn't matter, yet when not using productlister object, apparently does.

i have either found weird bug in mvc mechanism, or have missed something. hoping have missed something.

does have thought happening here? more importantly, can create code work??? missing declaration somewhere? if so, where?

someone please advise...

the strangest thing declare requires property twice, overriding first one:

var o = { a:[1], a:[2] }; o.a.join(' ') === '1 2' // false o.a.join(' ') === '2' // true

try instead:

requires: ['shop.view.productlister', 'shop.view.categorykey']

extjs extjs4 extjs4.1

Comments

Popular posts from this blog

web services - java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancer -

Accessing MATLAB's unicode strings from C -

javascript - mongodb won't find my schema method in nested container -