[SOLVED] Programmatically show/hide borderlayout regions
*NEW - Coolite Toolkit Version 0.6.0 now available for download or view examples.
 

Coolite Forums

Welcome Guest ( Login | Register )
 
[SOLVED] Programmatically show/hide...
Subscribe
Last Login: Today @ 1:40:24 PM
Posts: 157,
Posted 6/26/2008 1:28:52 PM

Group: Coolite Premium Member & Early Adopter
 I have a viewport in my masterpage.  The north region has a header image, a RadMenu control, and a RadToolbar control.  The other 4 regions have contentplaceholders that a content page can populate if needed.  If a region is empty, I would like to hide it.  How can I achieve this?  Since the viewport is in a masterpage, it needs to be very flexible.  I will have up to 50 pages in this website.  There could be 10 pages that use center region only, 20 pages that use center and west, and etc.  I want the content page to tell the masterpage which region to show. 
Last Login: Today @ 1:40:24 PM
Posts: 157,
Posted 6/26/2008 2:07:15 PM

Group: Coolite Premium Member & Early Adopter
 Another issue I have is that if the menu dropdowns are longer than height of North region, it will be hidden.  Is it possible to have the header and menu stuff outside of the viewport?


Post Attachments
Coolite.bmp (27 views, 257.89 KB)
Last Login: Today @ 1:46:47 PM
Posts: 31,
Posted 7/25/2008 2:15:36 PM

Group: Coolite Premium Member & Early Adopter
 I'm having the same problem I'm using DevExpress Menu and it would't overlay over BorderLayout North it stays behind.  Can some please help


Thank You..
~Zarzand~
Post Attachments
Untitled-2.jpg (13 views, 18.35 KB)
Last Login: Today @ 1:40:24 PM
Posts: 157,
Posted 7/26/2008 9:14:31 AM

Group: Coolite Premium Member & Early Adopter
 It's been a month, and I am still struggling with the same issue.  I have to demo Coolite to my managers in a week and if this can't be resolved, it will be a deal breaker. 
Last Login: 9/1/2008 3:29:41 AM
Posts: 10,
Posted 7/27/2008 1:46:37 AM

Group: Coolite Early Adopter
Try placing a div before the Viewport and place your menu inside this div.


    <div id="menuBar" style="position: absolute; top: 0; left: 0">
        <!-- place your menu here -->
    </div>
    <ext:ViewPort ID="ViewPort1" runat="server">
    ...


This should render the div on top of the viewport/borderlayout and hopefuly the menu will drop down on top of the layout regions as well.


Hope this helps.

--
Agha

Last Login: Today @ 2:12:17 PM
Posts: 387,
Posted 7/27/2008 7:38:42 AM

Group: Core Development Team
 Hi jchau,

For hiding region in codebehind just set Visible='false' for region panel

See small example


protected void Page_Load(object sender, EventArgs e)
        {
            HideRegion(BorderLayout1, RegionPosition.East);
            HideRegion(BorderLayout1, RegionPosition.North);
            HideRegion(BorderLayout1, RegionPosition.South);
        }

        private void HideRegion(BorderLayout layout, RegionPosition regionPosition)
        {
            BorderLayoutRegion region;
            switch (regionPosition)
            {
                case RegionPosition.North:
                    region = layout.North;
                    break;
                case RegionPosition.South:
                    region = layout.South;
                    break;
                case RegionPosition.East:
                    region = layout.East;
                    break;
                case RegionPosition.West:
                    region = layout.West;
                    break;
                case RegionPosition.Center:
                    throw new Exception("The center region can't be hide");
                    break;
                default:
                    throw new ArgumentOutOfRangeException("regionPosition");
            }

            if(region.Items.Count > 0)
            {
                region.Items[0].Visible = false;
            }
        }


If you need hide on client side then

           var west = Ext.getCmp('west-panel'); // this is west panel region
           west.hide();
           Ext.getCmp('viewport').doLayout();



Vladimir Shcheglov,
Coolite Inc.
Core Developer
Last Login: Today @ 3:11:47 PM
Posts: 1,173,
Posted 7/28/2008 12:56:02 AM

Group: Core Development Team
The Menu hiding problem is probably caused by the css z-index of the ViewPort regions being higher/greater than that of the 3rd party menu control. Are there options on the menu control to increase the css z-index? or maybe manually adding a css class which will override the default class?

Ultimately the best solution is going to be the <ext:Menu> control which is being worked on right now. The <ext:Menu> will fully integrate with all the Panel/Container controls and positioning will be managed automatically.
--
Geoffrey McGill
Coolite Inc.
Core Developer
twitter [personal] [coolite]
Last Login: Today @ 1:40:24 PM
Posts: 157,
Posted 7/29/2008 9:59:27 AM

Group: Coolite Premium Member & Early Adopter
Thanks Agha!!!!  I have originally tried putting the menu outside the viewport and it worked fine EXCEPT I also had a header in the north region.  If I put both the header and menu outside the viewport, my header won't show but my menu will.  It looked like the menu was over the header.  Sooooo frustrating.  But I used your approach and wrapped everything inside a div with position:absolute and everything is working now.  Thanks so much again!

geoffrey, I have tried setting the z-index of the menu to 10000000 but it still didn't work.  I do believe Telerik render their menu already with absolute positioning or something else weird.  But I am glad Agha's method worked. 

Last Login: Today @ 1:46:47 PM
Posts: 31,
Posted 7/29/2008 11:39:39 AM

Group: Coolite Premium Member & Early Adopter
 When will <ext:Menu> be available ?

Thank You.
~Zarzand~
Last Login: Today @ 3:11:47 PM
Posts: 1,173,
Posted 9/7/2008 4:02:24 AM

Group: Core Development Team
Hi Zarand,

The main thread tracking the status release of v0.6 is http://www.coolite.com/forums/Topic1224-7-1.aspx

Hope this helps.

--
Geoffrey McGill
Coolite Inc.
Core Developer
twitter [personal] [coolite]
« Prev Topic | Next Topic »
Reading This Topic
Active Users: 0 ( 0 guests, 0 members, 0 anonymous members )
No members currently viewing this topic.
All times are GMT -8:00, Time now is 4:04pm