Fill form with record data
Hi,
I'm having a tab layout with an form in one of the tabs. I'm sending the data to the view with the updateWithRecord function.
The data is being received and i can update a template for example. But when it comes to the form is doesn't work. All the names are the same as in the model and i can select the form with my code. It just fails doing the update.
any suggestions?
code
Code:
items: [
{
title: 'Bewerken',
cls: 'tabBewerken',
xtype: 'formpanel',
id:'pageForm',
items: [{
xtype: 'textfield',
name: 'id',
label: 'Pagina ID',
disabled: true
},{
xtype: 'togglefield',
name: 'inMenu',
label: 'In Menu'
},
{
xtype: 'textareafield',
name: 'title',
label: 'Pagina Notitie',
useClearIcon: true
}]
},
{
title: 'Bekijken',
tpl: '{content}',
cls: 'tabBekijken'
},
],
// Update Items with data from model
updateWithRecord: function(record)
{
console.log(record.data);
//fill form
var form = this.items.items[0];
form.load(record);
//update content
var content = this.items.items[1];
content.update(record.data.content);
//Update toolbar with title and edit id call
var toolbar = this.getDockedItems()[0];
toolbar.setTitle(record.get('title'));
//toolbar.getComponent('edit').record = record;
}