Ext


Go Back   Ext JS Forums > Ext JS Community Forums (2.0) > Ext 2.x: Help

Reply
 
Thread Tools
  #1  
Old 04-01-2009, 09:02 AM
thoreking thoreking is offline
Ext User
 
Join Date: Nov 2007
Posts: 58
thoreking is on a distinguished road
Talking TabPanel and Layout

Hi huys,

I'm trying to fit a textArea under a dataview all nested in a tabPanel.
so I have 4 elements like that :
var tabs = new Ext.TabPanel({
		id:'tabPanel',
		height:515,
        width:284,
		items:[	{xtype:'panel', id:'todayTab', layout:'border',border:false, title: 'Today',
				   items:[{xtype:'panel',id:'dataview',region:'north',items:[testView]}
						  ,{xtype:'panel',layout:'fit',region  :'center',items:[{xtype:'textarea',id: 'today'}]}
					]},
My problem is when I remove an item from the dataview, its height reduces and I would like that the textArea automatically resize to fit the area.
If the dataView is empty, the textArea should fill all the space.
I tried with a north region but I have to specify the height to make it work and It must be set automatically...
Please find in attachement what it looks like before removing an item from the dataView..

Thanks very much for your help.

T.
Attached Images
File Type: jpg layout.jpg (20.3 KB, 13 views)
Reply With Quote
  #2  
Old 04-01-2009, 09:13 AM
Animal's Avatar
Animal Animal is offline
Ext JS - Community Support Team
 
Join Date: Mar 2007
Location: East Midlands, UK
Posts: 24,303
Animal will become famous soon enough
Default

Format your code. It's unreadable.
__________________
ExtJs forum volunteer. No official connection to the Ext Company. I do not speak for them.
ExtJs consultancy offered. £ 50/hour. Evenings+weekends. the_bagbournes@btinternet.com

Search the forum: http://www.google.com/coop/cse?cx=01...%3Az7of1ufqccu
Read the docs too: http://extjs.com/deploy/dev/docs/
See Saki's samples: http://examples.extjs.eu/
Build your own Ext: http://extjs.com/products/extjs/build/
Scope: http://extjs.com/forum/showthread.ph...642#post257642
Reply With Quote
  #3  
Old 04-01-2009, 09:31 AM
wayned@escc wayned@escc is offline
Ext User
 
Join Date: Feb 2009
Posts: 60
wayned@escc is on a distinguished road
Default

http://jsbeautifier.org/
Reply With Quote
  #4  
Old 04-01-2009, 10:17 AM
thoreking thoreking is offline
Ext User
 
Join Date: Nov 2007
Posts: 58
thoreking is on a distinguished road
Default

Sorry for the code...
var tabs = new Ext.TabPanel({
    id: 'tabPanel',
    height: 515,
    width: 284,
    border: false,
    activeTab: 0,
    items: [{
        xtype: 'panel',
        id: 'todayTab',
        layout: 'border',
        border: false,
        title: 'Today',
        items: [{
            xtype: 'panel',
            id: 'test',
            //height: 70,
            region: 'north',
            items: [dataView]
        },
        {
            xtype: 'panel',
            layout: 'fit',
            region: 'center',
            items: [{
                xtype: 'textarea',
                id: 'today'
            }]
        }]
    },
in fact, this code is just an idea of what I tried, but my trouble is how a panel can be resize automatically when the 'north' one change...
The north one is a dataview (the height change each time an item is removed)
and the other one is just a textarea.
Both of them must be a part of a tab(today).

Thanks in advance for your help.

T.
Reply With Quote
  #5  
Old 04-01-2009, 11:28 AM
Animal's Avatar
Animal Animal is offline
Ext JS - Community Support Team
 
Join Date: Mar 2007
Location: East Midlands, UK
Posts: 24,303
Animal will become famous soon enough
Default

So how are you HOPING that the DataView gets sized? Who does the sizing, and why?
__________________
ExtJs forum volunteer. No official connection to the Ext Company. I do not speak for them.
ExtJs consultancy offered. £ 50/hour. Evenings+weekends. the_bagbournes@btinternet.com

Search the forum: http://www.google.com/coop/cse?cx=01...%3Az7of1ufqccu
Read the docs too: http://extjs.com/deploy/dev/docs/
See Saki's samples: http://examples.extjs.eu/
Build your own Ext: http://extjs.com/products/extjs/build/
Scope: http://extjs.com/forum/showthread.ph...642#post257642
Reply With Quote
  #6  
Old 04-01-2009, 12:04 PM
thoreking thoreking is offline
Ext User
 
Join Date: Nov 2007
Posts: 58
thoreking is on a distinguished road
Default

well I was just hoping I could find a solution to display a notification banner at the top of the textArea.
All I wanted is keeping the total height of the panel, and split vertically between a dataView ( or something else clickable) and a textArea.. I will work on something else then.

Thanks anyway.

T.
Reply With Quote
  #7  
Old 04-01-2009, 03:54 PM
Animal's Avatar
Animal Animal is offline
Ext JS - Community Support Team
 
Join Date: Mar 2007
Location: East Midlands, UK
Posts: 24,303
Animal will become famous soon enough
Default

No. This will work. You are very close.

I'm saying you are making a fundamental mistake which is flagged up ion manuy places in the API docs!

Try to say why you made the assumptions yoiu did.

The DataView is not being sized is it?

That is your problem.

YOu have to ask its Container to size it.

This is the fundamental of Ext that you MUST learn.

A Container's layout manager sizes child items.

You did not specify one.
__________________
ExtJs forum volunteer. No official connection to the Ext Company. I do not speak for them.
ExtJs consultancy offered. £ 50/hour. Evenings+weekends. the_bagbournes@btinternet.com

Search the forum: http://www.google.com/coop/cse?cx=01...%3Az7of1ufqccu
Read the docs too: http://extjs.com/deploy/dev/docs/
See Saki's samples: http://examples.extjs.eu/
Build your own Ext: http://extjs.com/products/extjs/build/
Scope: http://extjs.com/forum/showthread.ph...642#post257642
Reply With Quote
  #8  
Old 04-02-2009, 06:20 AM
thoreking thoreking is offline
Ext User
 
Join Date: Nov 2007
Posts: 58
thoreking is on a distinguished road
Default

Thanks for your help,

I knew the dataview container has to resize itself according to its child(the dataview).. that's why I put in comment the height because I tried any layout for it without any success.
Please, give me a clue.
Thanks
T.
Reply With Quote
  #9  
Old 04-02-2009, 06:38 AM
Animal's Avatar
Animal Animal is offline
Ext JS - Community Support Team
 
Join Date: Mar 2007
Location: East Midlands, UK
Posts: 24,303
Animal will become famous soon enough
Default

Clue?

I have told you precisely what is wrong.

You have wrapped your DataView inside a Panel which does not use a sizing layout manager.

Do not wrap it in a Panel unless you need to have a header, and toolbars, and if this is the case, use a layout which sizes the DataView in the way you want!
__________________
ExtJs forum volunteer. No official connection to the Ext Company. I do not speak for them.
ExtJs consultancy offered. £ 50/hour. Evenings+weekends. the_bagbournes@btinternet.com

Search the forum: http://www.google.com/coop/cse?cx=01...%3Az7of1ufqccu
Read the docs too: http://extjs.com/deploy/dev/docs/
See Saki's samples: http://examples.extjs.eu/
Build your own Ext: http://extjs.com/products/extjs/build/
Scope: http://extjs.com/forum/showthread.ph...642#post257642
Reply With Quote
  #10  
Old 04-02-2009, 06:52 AM
thoreking thoreking is offline
Ext User
 
Join Date: Nov 2007
Posts: 58
thoreking is on a distinguished road
Default

I tried any layout to auto size the height of the dataview without any success...
Reply With Quote
Reply

Thread Tools

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

All times are GMT -5. The time now is 12:33 PM.

© 2006-2009 Ext, LLC
Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.