I've been lurking here for a few weeks and this is my first post. Thank you all for participating in this forum. For someone learning Sencha Touch, this forum and the docs have proven invaluable.
I have a Reminder model that has a belongsTo reference to Client and ReminderType models:
Code:
App.models.Reminder = Ext.regModel('Reminder', {
fields: [
{
name: 'id',
type: 'int'
}, {
name: 'client_id',
type: 'int'
}, {
name: 'remindertype_id',
type: 'int'
}, {
name: 'duedate',
type: 'date',
dateFormat: 'n/j/Y'
}, {
name: 'body',
type: 'string'
}
],
associations: [
{ type: 'belongsTo', model: 'Client', primaryKey: 'id', foreignKey: 'client_id' },
{ type: 'belongsTo', model: 'ReminderType', primaryKey: 'id', foreignKey: 'remindertype_id' }
]
proxy: {
type: 'localstorage',
id: 're'
}
});
I'm showing a list of these reminders and I can't figure out how to access the associated objects or their fields.
I need to do something like this in the list, but I can not figure this out. I have tried looking at the model in Chrome and it's not obvious how to access these associations.
Code:
itemTpl: '{Client.name} {ReminderType.name}'
I found and tried omarc's override but I can't seem to get it working. The code never fires and I don't know if that's because I'm using a list or because I'm using the localStorage proxy.
Any help or pointers would be greatly appreciated.