PDA

View Full Version : Textarea as Tab Contents



richardtallent
26 Apr 2008, 1:03 PM
I have an existing TEXTAREA element that I would like to place in a tab in my Viewport.

I placed the TEXTAREA in a DIV and used specified the DIV as the contentEl.

The problem is, even with CSS height/width of 100%, TEXTAREA won't resize to match its DIV parent.

So, how can I get the TEXTAREA to always fill its entire tab, resizing with the ViewPort, and using the TEXTAREA's scroll bars rather than the tab's native scrolling?

Sample HTML:


<div id="tabTextContents">
<textarea name="mytext" id="mytext"></textarea>
</div>


Sample code:


function setupViewport() {
Ext.onReady(function() {
pageLayout = new Ext.Viewport({
layout: "border",
items: [
standardExtLayoutHeader(),
{
region: 'center',
xtype: 'tabpanel',
activeTab: 0,
tabPosition: 'top',
deferredRender: false,
border: false,
defaults: { closable: false, autoScroll: true, border: false, fitToFrame: true, collapsible: false, split: false },
items: [
{ title: 'Main', id: 'tabMain', contentEl: 'tabMainContents' },
{ title: 'Text', id: 'tabText', contentEl: 'tabTextContents', autoScroll: false }
]
}
]
});
});

}