Hello,
i have a problem with my current work, a user manager.
User list shows up, i select a row in the grid and a hit on button (or double clicking the row) shows a detail window for editing. I load the user data into a form and i load dependent data (i.e. the applications the user has activated) to show in a second tab.
The ajax request is working, the server returns correct json data with the dependent data, but the store for the dependent data is empty. When i examine the store in firebug, i see the received data in proxy > reader > rawData.
this is the user model
Code:
Ext.define('AccountManager.model.User', {
extend: 'Ext.data.Model',
fields: [
{name: 'account_id'},
{name: 'ikz'},
{name: 'account'},
{name: 'email'},
{name: 'anrede'},
{name: 'vorname'},
{name: 'nachname'},
{name: 'ka_vorwahl'},
{name: 'ka_telefon'},
{name: 'ka_fax'},
{name: 'gesperrt'},
{name: 'angelegt_von'},
{name: 'angelegt_am', type: 'date', dateFormat: 'Y-m-d'},
{name: 'update_passwd', type: 'date', dateFormat: 'Y-m-d'},
// {name: 'notice_passwd', type: 'date', dateFormat: 'Y-m-d'},
{name: 'bearbeitet_von'},
{name: 'bearbeitet_am', type: 'date', dateFormat: 'Y-m-d'},
{name: 'verfahren', type: 'Application'}
],
idProperty: 'account_id',
proxy: {
type: 'ajax',
api: {
read: '/admin/userread',
update: '/admin/userupdate'
},
reader: {
type: 'json',
root: 'results',
successProperty: 'success',
totalProperty: 'total'
},
writer: {
type: 'json',
root: 'user'
},
simpleSortMode: true
}
});
this is the application model
Code:
Ext.define('AccountManager.model.Application', {
extend: 'Ext.data.Model',
fields: [
'account_id',
'verfahrens_key', 'email_benachrichtigung',
{name: 'bezeichnung', mapping: 'anwendung_text'}
],
idProperty: ['account_id', 'verfahrens_key'],
proxy: {
type: 'ajax',
url: '/admin/accountverfahren',
reader: {
type: 'json',
root: 'results',
successProperty: 'success',
totalProperty: 'total'
},
simpleSortMode: true
}
});
this is the application store
Code:
Ext.define('AccountManager.store.Applications', {
extend: 'Ext.data.Store',
model: 'AccountManager.model.Application',
remoteSort: false
});
The next problem is to set this store as data store for an ItemSelector widget, but first i need to get the data in the store.