Hello List,
I have got a selectfield with some categories and a form which contains that selectfield. this form contains somemore textfields. Now, i want to change the textfields by changing the categories. Is that possible?
that´s my selectfield by changing it i want to get k1,k2,k3 or k4
HTML Code:
storeKategorie = new Ext.data.JsonStore({
fields: ['kategorie'],
data: [
{kategorie: "Bücher"},
{kategorie: "Veröffentlichungen(Paper)"},
{kategorie: "Vorträge"},
{kategorie: "Internetauftritte"}
]
});
kategorieauswahl = new Ext.form.ComboBox({
fieldLabel: 'Kategorie',
id:"kategorie",
store: storeKategorie,
displayField: 'kategorie',
typeAhead: true,
mode: 'local',
triggerAction: 'all',
emptyText:'Wählen Sie eine Kategorie...',
selectOnFocus:false,
anchor:'95%',
editable: false
});
these are two of four possible options for the catogires
HTML Code:
k1 = [{
xtype:'textfield',
fieldLabel: 'Titel',
name: 'title',
anchor:'95%'
},{
xtype:'textfield',
fieldLabel: 'Autor',
name: 'Autor',
anchor:'95%'
},{
xtype:'textfield',
fieldLabel: 'Verlag',
name: 'verlag',
anchor:'95%'
},{
xtype:'textfield',
fieldLabel: 'ISBN',
name: 'isbn',
anchor:'95%'
},
new Ext.form.DateField({
fieldLabel: 'Datum',
name: 'date',
anchor:'95%',
minValue: '01.01.1960',
maxValue: '31.12.2050'
})];
k2 = [{
xtype:'textfield',
fieldLabel: 'Titel',
name: 'title',
anchor:'95%'
},{
xtype:'textfield',
fieldLabel: 'Autor',
name: 'Autor',
anchor:'95%'
},{
xtype:'textfield',
fieldLabel: 'URL',
name: 'verlag',
anchor:'95%'
},
new Ext.form.DateField({
fieldLabel: 'Datum',
name: 'date',
anchor:'95%',
minValue: '01.01.1960',
maxValue: '31.12.2050'
})];
and here is the mainform which contains everything.
HTML Code:
top = new Ext.FormPanel({
labelAlign: 'center',
frame:true,
autowidth: true,
autoheight: true,
items: [{
layout:'column',
items:[{
columnWidth:.5,
layout: 'form',
items: [kategorieauswahl,k1] !!!!!!!here i want to change between k1-k4 by using the selectfield
},{
columnWidth:.5,
layout: 'form',
items: [{
html:'<img src="images/book_large.png" alt="Kategorie">'
}]
}]
},{
xtype:'htmleditor',
id:'bio',
fieldLabel:'Beschreibung',
height:500,
anchor:'98%'
}],
buttons: [{
text: 'Save'
},{
text: 'Cancel'
}]
});