I've started today using Sencha Touch and ran into some trouble. I hope you guys can help me a bit.
I've a list of customers and when i click on the disclosure button i want to display more detail of them in a from. Everything is working fine when displaying the detail is a simple Panel but when using a form in my view thing go wrong.
My model
Code:
Ext.define('SSL.model.Klant', {
extend: 'Ext.data.Model',
config: {
fields: ['seqklant', 'naam1', 'naam2', 'adres1', 'adres2', 'adres3', 'btw', 'tel', 'gsm', 'email']
}
})
My store
Code:
Ext.define('SSL.store.Klanten', {
extend: 'Ext.data.Store',
config: {
model: 'SSL.model.Klant',
sorters: 'naam1',
grouper: function(record){
return record.get('naam1')[0];
},
autoLoad: true,
proxy:{
type: 'jsonp',
url: 'http://localhost/SSL/json.php',
reader:{
type:'json',
rootProperty: 'responseData'
}
}
}
});
My controller
Code:
Ext.define('SSL.controller.Klant', {
extend: 'Ext.app.Controller',
config: {
refs: {
klantView: 'KlantContainer'
},
control: {
'KlantLijst': {
disclose: 'showDetail'
}
}
},
showDetail: function(list, record){
this.getKlantView().push({
xtype: 'KlantDetail',
title: record.data['naam1'],
data: record.data
});
}
})
And last but not least my View
Code:
Ext.define('SSL.view.KlantDetail', {
extend: 'Ext.form.Panel',
xtype: 'KlantDetail',
config: {
items: [{
xtype: 'fieldset',
items: [
{
xtype: 'textfield',
name : 'naam1',
label: 'Name',
tpl: '{naam1}',
readOnly: true
}
]
}]
}
})
As you can see i try to obtain data from my store through my controller by assigning data to the record.data. When i used a simple Panel and a tpl i could obtain my data, but now when i'm using a from to display my data with a tpl it doesn't work anymore.
Which is a correct way to obtain data in my form ?
Thx in advance!