PDA

View Full Version : dynamic form, field that doesn't render



pppswing
21 Dec 2010, 1:02 AM
Hello,

I'm using 3.3.1

I have a form with a combo box. When I'm selecting a field in my combo, a "filter_field_id" object is updated with a different field, however it doesn't display on the screen.

console log show that my filter_field_id object is really updated but the rendering is not !

I tried doLayout() without success. How can I render "filter_field_id" again ?
My form 'form_panel' includes a table layout panel 'formtab_panel' that includes the fields.




var filter_field_not = new Ext.Panel({ html: ''
});

var filter_field_chatid = new Ext.form.Field({
name: 'filters[chatid]',
width: 200
});
...

var filter_array_id = [filter_field_not, filter_field_netid, filter_field_chatid, filter_field_voipid];
var filter_field_id = filter_array_id[0];

In the combo

select:
function(combo, value) {
alert(combo.getValue());
filter_field_id = filter_array_id[combo.getValue()];
console.log(filter_field_id);
form_panel.doLayout(); <- it doesn't update the rendering
}
}


var formtab_panel = new Ext.Panel({
layout : 'table',
autoHeight: true,
autoWidth: true,
layoutConfig: {columns: 3},
defaults: {padding: 2},
items: [
{items:[filter_combo_choice]},{colspan: 2, items:[filter_field_id]},
]
});



var form_panel = new Ext.form.FormPanel({
frame:true,
labelWidth: 150,
autoHeight: true,
autoWidth: true,

items: [{
xtype: 'hidden',
name: 'old_tab_id',
value: old_tab_id
}

,{
xtype: 'fieldset',
title: '<?php echo __('New filter') ?>',
autoHeight: true,
autoWidth: true,
items: [
formtab_panel
]
}

]
});