While trying to execute the following code on show()
we get an exception that the links
attribute cannot find the model either if it is specified by class or if it is specified by entityName.
Ext.define('myapp.view.film.FilmsViewController', {
//extend: 'myapp.view.base.ViewController',
extend: 'Ext.app.ViewController',
alias: 'controller.films',
onAdd: function(button, event, options) {
this.createDialog(null)
},
createDialog: function(record) {
var me = this;
var view = me.getView(); //here is film panel
me.isEdit = !!record; //convert record to boolean
me.dialog = view.add({ //#3
xtype: 'filmwindow',
viewModel: { //#4
data: { //#5
title: record ? 'Edit: ' + record.get('title') : 'Add New Film',
},
links: { //#6
currentFilm: record || { //#7
//type: 'Film',
type: 'myapp.model.film.Film',
create: true
}
}
},
//session: true
});
me.dialog.show();
},
If we comment the links
part of the code the rest is working ok.
Here is the interesting part of the exception:
[E] Ext.app.ViewModel.getRecord(): Invalid model name: myapp.model.film.Film
log @ ext-all-rtl-debug.js?_dc=1446847440066:9121
Ext.apply.raise @ ext-all-rtl-debug.js?_dc=1446847440066:2606
Ext.raise @ ext-all-rtl-debug.js?_dc=1446847440066:2691
Ext.define.privates.getRecord @ ext-all-rtl-debug.js?_dc=1446847440066:99865
Ext.define.linkTo @ ext-all-rtl-debug.js?_dc=1446847440066:99748
Ext.define.privates.applyLinks @ ext-all-rtl-debug.js?_dc=1446847440066:100120
If you dive into the source code you will find that the if statement that checks whether myapp.model.film.Film
is a class fails..