dtex-lab
5 Nov 2009, 6:21 AM
Hi
I want render a panel in a tabpanel hidden... but I'm not able.
I try to add the hidden property to the panel, but it doesn't works.
The only way I found it after the tab panel rendered.. call the function hideTabStripItem
<html>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=UTF-8' />
<link rel="stylesheet" type="text/css" href="lib/extjs/resources/css/ext-all.css" />
<script type="text/javascript" src="lib/extjs/adapter/ext/ext-base-debug.js"></script>
<script type="text/javascript" src="lib/extjs/ext-all-debug.js"></script>
<script>
Ext.onReady(function () {
var vObjectFields1 = new Array();
var vObjectFields2 = new Array();
for (var x = 0; x < 10; x++) {
vObjectFields1.push(new Ext.form.TextField({
allowBlank: true,
fieldLabel: 'Tab 1 field -' + x
}));
vObjectFields2.push(new Ext.form.TextField({
allowBlank: true,
fieldLabel: 'Tab 2 field -' + x
}));
}
var vPanel1 = new Ext.Panel({
layout: 'form',
title: 'Panel 1',
items: vObjectFields1
});
var vPanel2 = new Ext.Panel({
layout: 'form',
title: 'Panel 2',
hidden: true,
items: vObjectFields2
});
var vToolbar = new Ext.Toolbar({
items: {
xtype: 'tbbutton',
cls: 'x-btn-icon',
text: 'hide tab',
handler: function (aButton, aEvent) // FIXME
{
aButton.ownerCt.ownerCt.hideTabStripItem(1);
}
}
});
var vTabPanel = new Ext.TabPanel({
region: 'center',
tbar: vToolbar,
activeTab: 0,
items: [vPanel1, vPanel2]
});
var vView = new Ext.Viewport({
layout: 'border',
items: vTabPanel
});
})
</script>
</head>
</body>
</body>
</html>
Ad you can see in my example, the Tab Panel 2 should be hidden when the tabpanel is rendered.. I add the Hidden : true properties..
But it seems not used by ExtJS.
There is a bug ? or ExtJS doesn't have this feature ? Or how can I do it without use an after render event ?
If ExtJs doesn't have this feature I will appreciate if it will be implemented..
I believe the hidden properies will be great
Thanks
I want render a panel in a tabpanel hidden... but I'm not able.
I try to add the hidden property to the panel, but it doesn't works.
The only way I found it after the tab panel rendered.. call the function hideTabStripItem
<html>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=UTF-8' />
<link rel="stylesheet" type="text/css" href="lib/extjs/resources/css/ext-all.css" />
<script type="text/javascript" src="lib/extjs/adapter/ext/ext-base-debug.js"></script>
<script type="text/javascript" src="lib/extjs/ext-all-debug.js"></script>
<script>
Ext.onReady(function () {
var vObjectFields1 = new Array();
var vObjectFields2 = new Array();
for (var x = 0; x < 10; x++) {
vObjectFields1.push(new Ext.form.TextField({
allowBlank: true,
fieldLabel: 'Tab 1 field -' + x
}));
vObjectFields2.push(new Ext.form.TextField({
allowBlank: true,
fieldLabel: 'Tab 2 field -' + x
}));
}
var vPanel1 = new Ext.Panel({
layout: 'form',
title: 'Panel 1',
items: vObjectFields1
});
var vPanel2 = new Ext.Panel({
layout: 'form',
title: 'Panel 2',
hidden: true,
items: vObjectFields2
});
var vToolbar = new Ext.Toolbar({
items: {
xtype: 'tbbutton',
cls: 'x-btn-icon',
text: 'hide tab',
handler: function (aButton, aEvent) // FIXME
{
aButton.ownerCt.ownerCt.hideTabStripItem(1);
}
}
});
var vTabPanel = new Ext.TabPanel({
region: 'center',
tbar: vToolbar,
activeTab: 0,
items: [vPanel1, vPanel2]
});
var vView = new Ext.Viewport({
layout: 'border',
items: vTabPanel
});
})
</script>
</head>
</body>
</body>
</html>
Ad you can see in my example, the Tab Panel 2 should be hidden when the tabpanel is rendered.. I add the Hidden : true properties..
But it seems not used by ExtJS.
There is a bug ? or ExtJS doesn't have this feature ? Or how can I do it without use an after render event ?
If ExtJs doesn't have this feature I will appreciate if it will be implemented..
I believe the hidden properies will be great
Thanks