Mar 26, 2015, 5:35 PM
change the layout of a panel dynamically
Hi
I wish to change the layout of a panel( dynamically) based on a combo box list (listing different layout types).
I call a Javascript function on the select handler of the combobox.
<script type="text/javascript">
var setLayout = function (index) {
if (index == 1) {
#{pWizardContent}.setLayout(Ext.panel.LayoutType.V BoxLayout);
// #{pWizardContent}.Layout='VBoxLayout';
// #{pWizardContent}.LayoutConfig.Add(new VBoxLayoutConfig { Pack = BoxPack.Start, Align = VBoxAlign.Stretch });
}
if (index == 2) {
//set another layout
}
}
</script>
This does not work. Please provide some samples for this , the panel needs to be with all the same Components, but include the ability to change the .Layout and re-render.
I wish to change the layout of a panel( dynamically) based on a combo box list (listing different layout types).
I call a Javascript function on the select handler of the combobox.
<script type="text/javascript">
var setLayout = function (index) {
if (index == 1) {
#{pWizardContent}.setLayout(Ext.panel.LayoutType.V BoxLayout);
// #{pWizardContent}.Layout='VBoxLayout';
// #{pWizardContent}.LayoutConfig.Add(new VBoxLayoutConfig { Pack = BoxPack.Start, Align = VBoxAlign.Stretch });
}
if (index == 2) {
//set another layout
}
}
</script>
This does not work. Please provide some samples for this , the panel needs to be with all the same Components, but include the ability to change the .Layout and re-render.
Last edited by Girija; Mar 26, 2015 at 6:05 PM.