I was was wondering whether someone could give some help with a peculiar problem that I am having in ExtJS 4. I have a defined a store that takes some of the values that I have specified in the 'read' and 'create' properties of the api object in the proxy from a class where these values are defined in the statics section of the class. However, when I run the app, I keep getting the error:
**Uncaught TypeError: Cannot read property 'Url' of undefined**.
Here is the store
Ext.define('MyApp.store.address.AddressStore',
{
extend: 'Ext.data.Store',
model: 'MyApp.model.address.AddressModel',
requires: ['MyApp.props.Url'],
proxy: {
type: 'ajax',
api: {
create: MyApp.props.Url.Address.ADD_ADDRESS_URL, //This is defined in the static class below
read: MyApp.props.Url.Address.GET_ALL_ADDRESSES_URL //As is this
},
reader: {
type: 'json',
root: 'Addresses'
}
}
}
);
Heres is the the class that defines the static properties MyApp.props.Url
Ext.define('MyApp.props.Url', {
statics: {
Address: {
ADD_ADDRESS_URL: 'Address/AddAddress',
GET_ALL_ADDRESSES_URL: 'Address/GetAllAddresses',
GET_ALL_ADDRESS_TYPES_URL: 'Address/GetAllAddressTypes'
}
}
});