LarssaAndin
15 Oct 2012, 5:30 AM
I've started to use the sencha command for my now fairly big project (should have started earlier but hey, better late then never ;-)). I've created my all-classes.js using sencha app build
Anyway, I get issues with my models due to missing the BelongsTo and HasMany associations.
When load my app it tries to find the file http://localhost/association/belongsto.js (http://localhost/association/belongsto.js?_dc=1350299721164).
I get the error [Ext.Loader] Failed loading 'association/belongsto.js', please verify that the file exists from all-classes.js
I created a simple example where I just add a model to the generated app using:
sencha generate app MyApp /path/to/MyApp
In Main.js I just add this line:
models: ['WebDialog']
And then create the file MyApp/app/model/Dialog.js.
Ext.define('MyApp.model.Dialog', {
extend:'Ext.data.Model',
// require: 'MyApp.model.Row', // Skipping require to avoid need of that file in this example code
fields:[
{name:'id', type:'int'}
],
hasMany:{
model:'MyApp.model.Row', // Row model doesn't exist, but that is not relevant for this issue
name:'rows'
}
});
Running sencha app build will result in an application that generates the following errors:
Uncaught Error: [Ext.Loader] Failed loading 'association/hasmany.js', please verify that the file exists all-classes.js:1 (file:///D:/temp/testapp/build/testapp/all-classes.js)
Uncaught Error: [Ext.Loader] Failed loading 'MyApp/model/Dialog.js', please verify that the file exists
Looking at the all-classes.js I see that it's correct that the hasmany code hasn't been added. I tried adding an explict requires in the app.js to just force the inclusion of this code and it is then added but it doesn't remove the problem.
What can I do to get around this problem?
Versions used:
ExtJS 4.1.2a
Sencha Command v3.0.0.190.
Anyway, I get issues with my models due to missing the BelongsTo and HasMany associations.
When load my app it tries to find the file http://localhost/association/belongsto.js (http://localhost/association/belongsto.js?_dc=1350299721164).
I get the error [Ext.Loader] Failed loading 'association/belongsto.js', please verify that the file exists from all-classes.js
I created a simple example where I just add a model to the generated app using:
sencha generate app MyApp /path/to/MyApp
In Main.js I just add this line:
models: ['WebDialog']
And then create the file MyApp/app/model/Dialog.js.
Ext.define('MyApp.model.Dialog', {
extend:'Ext.data.Model',
// require: 'MyApp.model.Row', // Skipping require to avoid need of that file in this example code
fields:[
{name:'id', type:'int'}
],
hasMany:{
model:'MyApp.model.Row', // Row model doesn't exist, but that is not relevant for this issue
name:'rows'
}
});
Running sencha app build will result in an application that generates the following errors:
Uncaught Error: [Ext.Loader] Failed loading 'association/hasmany.js', please verify that the file exists all-classes.js:1 (file:///D:/temp/testapp/build/testapp/all-classes.js)
Uncaught Error: [Ext.Loader] Failed loading 'MyApp/model/Dialog.js', please verify that the file exists
Looking at the all-classes.js I see that it's correct that the hasmany code hasn't been added. I tried adding an explict requires in the app.js to just force the inclusion of this code and it is then added but it doesn't remove the problem.
What can I do to get around this problem?
Versions used:
ExtJS 4.1.2a
Sencha Command v3.0.0.190.