-
17 Nov 2008 11:21 AM #1
How to add checkboxes at a specific form place
How to add checkboxes at a specific form place
Hi,
i want to add some checkboxes, generated dynamically, to a specific place in a form. I know how to add the checkboxes, but i don't know how to add them to e specific place.
[code] var itemsTypeOfLodgings = [{xtype: 'label', text: 'Art der Unterkunft', cls:'x-form-check-group-label', anchor:'-15'}];
var ajaxTypeOfLodgings = new Ext.data.Connection({});
ajaxTypeOfLodgings.request({
url: 'test.ajax.php',
success: function(r, o){
obj = eval(r.responseText);
var len = obj.length;
for(var x = 0; x < len; x++) {
cb = new Ext.form.Checkbox({
hideLabel: true,
name: 'arrTypeOfLodgings[]',
boxLabel: obj[x].boxLabel,
value: obj[x].inputValue
});
frmVac.add(cb);
}
frmVac.doLayout();
},
failure: function(r, o){
//alert('Fehler');
},
params: {action: 'getLodgings'}
});
frmVac = new Ext.form.FormPanel({
id: 'frmVac',
layout: 'form',
labelWidth: 330, // label settings here cascade unless overridden
frame:true,
title: 'Suche',
bodyStyle:'padding:5px 5px 0',
width: 600,
defaults: {
width: 100,
allowBlank:false,
format: 'd.m.Y'
},
defaultType: 'datefield',
items: [{
xtype: 'numberfield',
fieldLabel: 'Dauer des Aufenthalts',
id: 'vacNights',
allowBlank: true
},{
fieldLabel: 'Anreise',
id: 'vacStart'
},{
fieldLabel: 'Abreise',
id: 'vacEnd',
allowBlank: true
},{
xtype:'fieldset',
width: 600,
checkboxToggle:true,
collapsed: false,
title: 'erweiterte Suchm
-
18 Nov 2008 2:55 AM #2
Ok, i can create my checkboxes before i render the form, it works, but it would be interesting for me how to add checkboxes somewhere in a large form, f. e. under a specific panel.
-
18 Nov 2008 4:49 AM #3Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- The Netherlands
- Posts
- 24,251
- Vote Rating
- 41
You could use:
Code:// Insert checkbox into panel panel.insert(position, checkbox); panel.doLayout(); // Add checkbox to fields list. form.getForm().add(checkbox);


Reply With Quote