In the code and screenshots below, my question is
Why is the model trying to load from outside the app directory?
As the code and screenshots indicate the view model loads as expected from the right path, but the model itself is attempting to be found from the top level path, outside of the app root. Why?
Model
Code:
Ext.define('ezWeb360Mobile.model.empbasicinfomodel', {
extend: 'Ext.data.Model',
fields: [
{ name: 'id', type: 'int' },
{ name: 'firstName', type: 'string' },
{ name: 'lastName', type: 'string' },
{ name: 'address1', type: 'string' },
{ name: 'address2', type: 'string' },
{ name: 'city', type: 'string' },
{ name: 'state', type: 'string' },
{ name: 'zipCode', type: 'string' },
{ name: 'homePhone', type: 'string' },
{ name: 'workPhone', type: 'string' }
],
proxy: [{
type: 'ajax',
api: {
read: '/dev_andy003/ezWeb360Mobile/resources/mobileTData.aspx?method=getBasicInfo',
create: '',
update: '',
destroy: ''
},
writer: {
type: 'json',
writeAllFields: true
},
reader: {
rootProperty: 'data',
type: 'json'
},
}]
});
ViewModel
Code:
Ext.define('ezWeb360Mobile.view.employee.myinformation.EmployeeBasicInfoModel', {
extend: 'Ext.app.ViewModel',
alias: 'viewmodel.employee-myinformation-employeebasicinfo',
data: {
name: 'ezWeb360Mobile'
},
stores: {
basicInfoStore: {
model: 'ezWeb360Mobile.model.basicinfoempmodel',
autoLoad: true
}
}
});
Screen Shot 2019-02-28 at 9.05.06 AM.jpg
Screen Shot 2019-02-28 at 9.02.46 AM.jpg
The very same configuration in another project is working perfectly. The different in the projects, the code above is running Modern 6.6 and the code below is running Classic 6.6
Code:
Ext.define('ajlfantasy.model.playermodel', {
extend: 'Ext.data.Model',
fields: [
{ name: 'id', type: 'int' },
{ name: 'esbid', type: 'string' },
{ name: 'gsisPlayerId', type: 'string' },
{ name: 'nflPlayerId', type: 'int' },
{ name: 'teamId', type: 'int' },
{ name: 'firstName', type: 'string' },
{ name: 'lastName', type: 'string' },
{ name: 'jerseyNum', type: 'int' },
{ name: 'position', type: 'string' },
{ name: 'height', type: 'string' },
{ name: 'weight', type: 'int' },
{ name: 'age', type: 'int' },
{ name: 'exp', type: 'int' },
{ name: 'college', type: 'string' },
{ name: 'yrentered', type: 'int' },
{ name: 'yearadded', type: 'int' },
{ name: 'yearremoved', type: 'int' },
{ name: 'teamstatus', type: 'int' },
{ name: 'injured', type: 'int' },
{ name: 'injurylength', type: 'string' },
{ name: 'ir', type: 'int' },
{ name: 'practicesquad', type: 'int' },
{ name: 'suspended', type: 'int' },
{ name: 'returnsuspenddate', type: 'date' },
{ name: 'depthchart', type: 'int' },
{ name: 'lineside', type: 'string' }
],
proxy: {
type: 'ajax',
api: {
read: '/resources/players.php?method=getTeamRoster',
create: '',
update: '',
destroy: ''
},
writer: {
type: 'json',
writeAllFields: true
},
reader: {
type: 'json',
rootProperty: 'players'
}
}
});
Code:
Ext.define('ajlfantasy.model.playermodel', {
extend: 'Ext.data.Model',
fields: [
{ name: 'id', type: 'int' },
{ name: 'esbid', type: 'string' },
{ name: 'gsisPlayerId', type: 'string' },
{ name: 'nflPlayerId', type: 'int' },
{ name: 'teamId', type: 'int' },
{ name: 'firstName', type: 'string' },
{ name: 'lastName', type: 'string' },
{ name: 'jerseyNum', type: 'int' },
{ name: 'position', type: 'string' },
{ name: 'height', type: 'string' },
{ name: 'weight', type: 'int' },
{ name: 'age', type: 'int' },
{ name: 'exp', type: 'int' },
{ name: 'college', type: 'string' },
{ name: 'yrentered', type: 'int' },
{ name: 'yearadded', type: 'int' },
{ name: 'yearremoved', type: 'int' },
{ name: 'teamstatus', type: 'int' },
{ name: 'injured', type: 'int' },
{ name: 'injurylength', type: 'string' },
{ name: 'ir', type: 'int' },
{ name: 'practicesquad', type: 'int' },
{ name: 'suspended', type: 'int' },
{ name: 'returnsuspenddate', type: 'date' },
{ name: 'depthchart', type: 'int' },
{ name: 'lineside', type: 'string' }
],
proxy: {
type: 'ajax',
api: {
read: '/resources/players.php?method=getTeamRoster',
create: '',
update: '',
destroy: ''
},
writer: {
type: 'json',
writeAllFields: true
},
reader: {
type: 'json',
rootProperty: 'players'
}
}
});
Now could this point to a bug in Modern 6.6 and creating stores in this fashion?