PDA

View Full Version : add input into form



ApacheLogs
3 Dec 2009, 3:09 AM
Hi,
I would like add an input in my form in a listeners




var fp = new Ext.FormPanel({
id:'fp',
fileUpload : true,
.......
........
.......
new Ext.form.ComboBox({
allowBlank : true,
displayField : 'model_name',
emptyText : 'Aucun',
fieldLabel : 'Le model',
hiddenName : 'idmod',
id : 'modal_fo_upload',
name : 'modal_fo_upload',
minListWidth : 220,
mode : 'local',
resizable : true,
reviewField : false,
editable : false,
selectOnFocus : true,
store : models_store,
typeAhead : false,
triggerAction : 'all',
valueField : 'id_model',
listeners: {
'beforeselect': function(){
return add_input(Ext.getCmp('file_name').getValue(),fp);
}
}

in the function i add the new input


function add_input(mask,form)
{
alert(form);
var tir = new Ext.form.TextField({
id : 'tir',
width : 200,
fieldLabel : 'sdfdsdfmmmmmmmmm',
name : 'tir'
})
form.add(tir);
//alert('verification avec le mask');
}

it dont work
please help !!

3 Dec 2009, 4:48 AM
stop using alerts to develop.

try form.doLayout() after the form.add()

ApacheLogs
3 Dec 2009, 7:00 AM
thanks jgarcia (http://www.extjs.com/forum/member.php?u=172)
it works