dynamically. adding a panel to a containter
By mike | January 6, 2009
I`ve tried using column layout and it didn`t work (bug?) (http://extjs.com/forum/showthread.php?t=19599)so I`m trying table layout but it also doesn`t work for me.
var p = new Ext.Panel({
renderTo: 'container',
id: 'mainPanel',
layout:'table',
layoutConfig: {
// The total column count must be specified here
columns: 4
},
items: [{
title: 'Column 1',
id: 'panel1',
html: Ext.example.bogusMarkup,
},{
title: 'Column 2',
id: 'panel2',
html: Ext.example.bogusMarkup,
},{
title: 'Column 3',
id: 'panel3',
html: Ext.example.bogusMarkup,
}]
});
var mainPanel = Ext.getCmp('mainPanel');
mainPanel.add( new Ext.Panel({
title: 'Column 4',
id: 'panel4',
html: Ext.example.bogusMarkup,
}));
mainPanel.doLayout();
I`ve tried setting the columns in the layoutConfig to 3 or 4 but there is no difference.
What am I doing wrong?
Thanks for your help.
Mark
(Incidentally to the above poster, the ColumnLayout fix -- adding a call to the ContainerLayout baseclass in the OnLayout method -- didn't work for the TableLayout problem.)
I'm not sure I understand. DHTML defines these methods:
table.tBodies[0].insertRow(-1).insertCell(-1).
You can similarly remove rows using 'deleteRow()'.
This bug or feature is very discouraging since it means I've to get down and dirty with DHTML and worry about browser incompatibilities - exactly the kind of stuff this layout abstraction is supposed to solve :(
In the case of table layout its not intuitive like the other two cases because in a table layout you are adding a component, while in the other two cases you are changing the layout structure itself.
#If you have any other info about this subject , Please add it free.# |
Topics: enart.xn--fiqs8sjn5by0n.com | edit
