-
26 Mar 2008 6:40 AM #1
textarea as the body of a tabpanel
textarea as the body of a tabpanel
hi.
In my center region i have a tabPanel.
how can I place a textarea as the body of this tabPanel.
I am trying it this way but its not working:
could anyone throw some hints please?
Code:var fileTabPanel = new Ext.TabPanel({ id:'tabId', title: 'kop', closable: true, autoScroll:true, xtype: 'textarea', border:false, height:'auto', tabTip:tabId, border:true, value:'my sample text' }); centerPanel.add(fileTabPanel); fileTabPanel.show();
-
26 Mar 2008 7:22 AM #2Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- The Netherlands
- Posts
- 24,251
- Vote Rating
- 44
You can only add panels to a tabpanel, so you should use:
Code:var fileTabPanel = new Ext.TabPanel({ ... items:[{ title: 'title-in-tab', layout: 'fit', items: [{ xtype:'textarea', id:'htmlSourceCode' }] }] });
-
26 Mar 2008 7:29 AM #3
or
Code:var fileTabPanel = new Ext.TabPanel({ id:tabId, title: node.text, closable: true, autoScroll:true, xtype: 'tabpanel', border:false, height:'auto', tabTip:tabId, border:true, items:{ title: 'A Big TextArea', bodyCfg:{tag: 'textarea', name:'htmlSourceCode'} id:'htmlSourceCode' } }); centerPanel.add(fileTabPanel); fileTabPanel.show();Search the forum: http://www.google.com/coop/cse?cx=01...%3Az7of1ufqccu
Read the docs too: http://extjs.com/deploy/dev/docs/
Scope: http://extjs.com/forum/showthread.ph...642#post257642
-
27 Mar 2008 4:32 AM #4
Thank you very much guys.
it worked. however both of your solutions gave me a tab inside another tab. something i didnt want
.
i modified the code a little and I got the result that i wanted, one tab in the center panel and inside a textarea is displayed.
However I am not so sure if this is good. can you tell me if my modification is properly done?
here is me code
Code:var fileTabPanel = new Ext.TabPanel({ id:tabId, title: node.text, closable: true, autoScroll:true, xtype: 'tabpanel', border:false, height:'auto', tabTip:tabId, bodyCfg:{tag: 'textarea', id:node.text+'fileEditor'}, border:false });
-
27 Mar 2008 5:33 AM #5
Me confused.
What do you want?
Because you can't have a TabPanel which is a textarea. It contains other elements.Search the forum: http://www.google.com/coop/cse?cx=01...%3Az7of1ufqccu
Read the docs too: http://extjs.com/deploy/dev/docs/
Scope: http://extjs.com/forum/showthread.ph...642#post257642
-
27 Mar 2008 5:33 AM #6
Might you, erm, mean "Panel"????
Search the forum: http://www.google.com/coop/cse?cx=01...%3Az7of1ufqccu
Read the docs too: http://extjs.com/deploy/dev/docs/
Scope: http://extjs.com/forum/showthread.ph...642#post257642
-
28 Mar 2008 8:22 AM #7
I was just wondering if it is correct to include
the line: bodyCfg:{tag: 'textarea', id:node.text+'fileEditor'}
for my tabPanel.
I mean by doing this, is the textarea actually located in the body of this tabPanel?
-
28 Mar 2008 8:27 AM #8
A TabPanel contains several Panels doesn't it? Each one with different content, and it displays selector tabs along the top to select which one of its several Panels you want to show.
A textarea cannot hold these Panels.
Really, explain what you're trying to do!Search the forum: http://www.google.com/coop/cse?cx=01...%3Az7of1ufqccu
Read the docs too: http://extjs.com/deploy/dev/docs/
Scope: http://extjs.com/forum/showthread.ph...642#post257642
-
24 Feb 2010 12:20 AM #9
-
24 Feb 2010 12:33 AM #10
OK, I managed to do it with:
where id: 'remarks-textarea' is equivalent to your 'htmlSourceCode'. This is the correct method, right?Code:Ext.getCmp('remarks-textarea').update(r.json.remarks);
Thanks again


Reply With Quote