PDA

View Full Version : Uncaught Exception on Model



TampaBay55
22 Oct 2012, 7:53 AM
Greetings:

Can anyone see a problem with the following code?

/**
* GrpData Model
**/
Ext.define('GlsAmCrm.model.grpModel',{
extend: 'Ext.data.Model',
config:{
idProperty: 'recordid',
fields:[
{name: 'recordid', type: 'string'},
{name: 'groupname', type: 'string'},
{name: 'address1', type: 'string'},
{name: 'address2',type: 'string'},
{name: 'city',type: 'string'},
{name: 'state',type: 'string'},
{name: 'zipcode',type: 'string'},
{name: 'telephone',type: 'string'},
{name: 'faxnumber',type: 'string'},
{name: 'webaddress',type: 'string'}
]
}
});

For some reason I am getting the following error:

Uncaught Error: The following classes are not declared even if their files have been loaded: 'GlsAmCrm.model.grpModel '. Please check the source code of their corresponding files for possible typos: 'app/model/grpModel .js
Thanks for any help

*** This has been corrected....there appears to have been some strange character placed in the name of the model when I declared it in the app.js....Very odd ***

mitchellsimoens
24 Oct 2012, 5:21 AM
Look at the error, it says to check for typos in the path. The directory and file names must be 100% and case sensitive so that model needs to be in the file:

app/model/grpModel.js

And when you require it you must require like:

in Ext.application's model config:

'grpModel'

In a requires:

'GlsAmCrm.model.grpModel'