-
25 May 2007 10:24 AM #1
How to strech an TextArea to fit a Tab?
How to strech an TextArea to fit a Tab?
I need to make that textarea fills the Tab in Width and Height, how?
I have this (see the text area field there):
JavaScript:Code:<div id="EDIT-PROFILE-TEXT-DLG" style="visibility:hidden;position:absolute;top:0px;"> <div class="x-dlg-hd">Editing profile text...</div> <div class="x-dlg-bd"> <div class="x-dlg-tab" title="Profile Description"> <div class="inner-tab"> <textarea id="profileTextEdit" rows="10" style="width:99%; height:100%;" ><?=$description_edit;?></textarea> </div> </div> <div class="x-dlg-tab" title="Profile Headline"> <div class="inner-tab"> </div> </div> </div> </div> </div>
Code:var ProfileTextEdit = function(){ var dialogProfileEditText, showBtn; return { init : function(){ showBtn = Ext.get('profileTextView'); // the text paragraph showBtn.on('dblclick', this.showDialog, this); }, showDialog : function(){ if(!dialogProfileEditText){ dialogProfileEditText = new Ext.BasicDialog("EDIT-PROFILE-TEXT-DLG", { autoTabs:true, width:600, height:350, minWidth:300, minHeight:250, animateTarget: showBtn, draggable: false, shadow:true, fixedcenter: true }); dialogProfileEditText.addKeyListener(27, dialogProfileEditText.hide, dialogProfileEditText); dialogProfileEditText.addButton('Submit', function(){saveProfileText()} ); dialogProfileEditText.addButton('Close', dialogProfileEditText.hide, dialogProfileEditText); } dialogProfileEditText.show(showBtn.dom); } }; }(); ProfileTextEdit.init();
-
25 May 2007 10:31 AM #2
Use Element.setSize on textarea. Listen to the dialog resize event if you want scale it with the dialog.
Tim Ryan
Read BEFORE posting a question / BEFORE posting a Bug
Use Google to Search - API / Forum
API Doc (4.x | 3.x | 2.x | 1.x) / FAQ / 1.x->2.x Migration Guide / 2.x->3.x Migration Guide
-
25 May 2007 10:37 AM #3
Something like this?
Code:Ext.get('profileTextEdit').setSize('100%', '100%');
-
25 May 2007 10:43 AM #4
Look at the doc - setSize takes numbers, not strings. I'm not sure that setting size in percentages for a textarea works x-browser, but if so, you should do that with setStyle()
Tim Ryan
Read BEFORE posting a question / BEFORE posting a Bug
Use Google to Search - API / Forum
API Doc (4.x | 3.x | 2.x | 1.x) / FAQ / 1.x->2.x Migration Guide / 2.x->3.x Migration Guide
-
25 May 2007 10:57 AM #5
-
25 May 2007 11:42 AM #6
Look at the blog example in \examples\dialog:
Code:txtComment = Ext.get('comment'); // ... var sizeTextBox = function(){ txtComment.setSize(dialog.size.width-44, dialog.size.height-264); }; sizeTextBox();
-
26 May 2007 2:07 AM #7
Thanks a lot for your help. It was really helpful, code adapted...



Reply With Quote