PDA

View Full Version : Fill a Panel with another View



blade226
29 Mar 2012, 1:55 AM
Hello,

I want to fill a tabPanel with another "ViewPort".
In the TabPanel i need the regions north,center and west.

TabPanel:

tab = Ext.create('Ext.panel.Panel', {
itemId: tabId,
title: nodeText,
closable:true,
items: [artikelGrid]
});
tabPanel.add(tab);



Here my try.


var store_benutzer = Ext.create('Ext.data.Store', {

fields:['user_name','rechte']
,
proxy : {
type:"ajax",
url:"includes/benutzerdaten.php",
waitMsg: 'Loading...',
reader:{
type:"json"
},
writer: {
type: 'json'
}
},
autoLoad:true,
autoSync: true

});

var uebersicht = Ext.create ("Ext.grid.Panel" , {
region: 'west',
width : 200,
title : "Benutzerdaten",
store : store_benutzer,
autoScroll : true,
frame:true,
columns:[
{header:"Benutzername",dataIndex:"user_name"},
{header:"Recht",dataIndex:"rechte"},
]
});

var bearbeitung = Ext.create ("Ext.form.Panel" , {
region: 'center',
width : 200,
url:"includes/benutzerdaten.php",
layout: 'anchor',
id: "autoid",
title : "Benutzerdaten bearbeiten",

items: [{
xtype:"textfield",
fieldLabel: 'First Name',
name: 'first',
allowBlank: false
}],
buttons: [{
text: 'Reset',
handler: function() {
var aid = Ext.getCmp ("autoid").getForm().reset();
}
}]
});


artikelGrid = Ext.create('Ext.container.Container', {
layout: 'border',
items: [uebersicht,bearbeitung]

One of the items as center (uebersicht or bearbeitung) the browser shows, but both at same time in different regions and "nothing to see"

Is this possible and who?

Thx fpr response.

mitchellsimoens
29 Mar 2012, 7:43 AM
You should really do


tabPanel.add(artikelGrid);

And skip the panel you have, of course giving artikelGrid a title.

blade226
29 Mar 2012, 9:57 PM
Sorry I don't understand it. Can you please explain in more detail or give an Example.