PDA

View Full Version : record show on Panel



DetBerlin
12 Nov 2012, 1:20 PM
hi Everybody,

nothing on this subject was to be found on google... I would like a record in the list select and display data from the second array field on my panel without using a text box. is it possible? and if like? here an example how I thought it... Unfortunately it works not...





Ext.onReady(function() {
var XPZus = Ext.get('mitte').getX(); var YPZus = Ext.get('mitte').getY();
Ext.create('Ext.data.Store',{storeId:'zusSource', fields:['stftxt01', 'stftxt02'],
proxy:{type:'ajax', url:'phfoods.php?fodWahlen=1'}, autoLoad:true});

var gridForm = Ext.create('Ext.form.Panel',{border:false, layout:'column', x:8, y:10, width:674, bodyStyle:'background:#e1e1e6;',
items:[{xtype:'grid', width:274, height:404, store:Ext.data.StoreManager.lookup('zusSource'), enableColumnMove:false, enableColumnResize:false, sortableColumns:false,
columns: [{text:'Artikelbezeichnung', componentCls:'wbGrids2', width:255, hideable:false, dataIndex:'stftxt01'}],
defaults:{flex:1, overflowY:'scroll'},
listeners:{selectionchange:function(model, records) {if (records[0]) {this.up('form').getForm().loadRecord(records[0]);}}},
},{
xtype:'panel', id:'test2', x:8, width:392, height:404
}]});
var zusWindow = Ext.create('Ext.window.Window',
{title:'Zusatzstoffe', modal:true, resizable:false, shadow:false, draggable:false, x:XPZus + ((743 - 702) / 2), y:YPZus + ((666 - 456) / 2), width:702,
height:456, bodyStyle:'background:#e1e1e6;', items:gridForm}); zusWindow.show();
})




i hope you can help me

detberlin

tvanzoelen
13 Nov 2012, 2:14 AM
You can do something with templates like this



var tplMarkup = [
'<b>{field1}<br/>',
'<b>{field2}<br/>',
];

var tpl = Ext.create('Ext.Template', tplMarkup);
tpl.overwrite(myPanel.body, records[0].data);

DetBerlin
13 Nov 2012, 10:12 AM
thanks for you solution,

i have found other way....
and it works.....

in the next time follow example.