Dijit BorderContainer

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Dijit BorderContainer

karozans
Has anyone been able to successfully get a border container programmatically added to a div (not document.body) using 100% for the height and width?

I cannot seem to get it working.

I even copied the code down exactly from...

http://dojotoolkit.org/reference-guide/1.10/dijit/layout/BorderContainer.html

I copied the code from the topmost box.  With pixels for the height and width, it works.  With 100% it doesn't.

What's up?
Reply | Threaded
Open this post in threaded view
|

Re: Dijit BorderContainer

Karl Tiedt
I would guess your 100% div does not have a size above it... meaning it has no idea what 100% is 100% of.

This is why when you do a full page layout (body->BC) you have html, body { height: 100%; width: 100%; }

Without seeing your actual example though, its hard to say.

-Karl Tiedt

On Mon, Feb 9, 2015 at 9:52 AM, karozans <[hidden email]> wrote:
Has anyone been able to successfully get a border container programmatically
added to a div (not document.body) using 100% for the height and width?

I cannot seem to get it working.

I even copied the code down exactly from...

http://dojotoolkit.org/reference-guide/1.10/dijit/layout/BorderContainer.html

I copied the code from the topmost box.  With pixels for the height and
width, it works.  With 100% it doesn't.

What's up?



--
View this message in context: http://dojo-toolkit.33424.n3.nabble.com/Dijit-BorderContainer-tp4005283.html
Sent from the Dojo Toolkit mailing list archive at Nabble.com.
--
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/

[hidden email]
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest


--
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/

[hidden email]
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
Reply | Threaded
Open this post in threaded view
|

Re: Dijit BorderContainer

karozans
This post was updated on .
Hi Karl.  Thanks for the reply.  You were right.  I got that working.

However.  I guess I am a little confused on what I should do.

I need to programmatically start adding charts to this border container.  Since I don't know how many charts I will be adding, I want the BorderContainer to grow in height as I add Charts to it.  Even if my main page starts to scroll.

How would I accomplish that?

Thanks
Reply | Threaded
Open this post in threaded view
|

Re: Dijit BorderContainer

Karl Tiedt
Are you adding them as children of the BC or adding them to the content region of the BC? 

This is where seeing code usually helps but just to be thorough; if you are adding them to the content region, that region will continue to expand (adding scrollbars on that region), if you are adding them as additional children, I honestly have never setup a BC that way to have a definitive answer on how it will behave.

-Karl Tiedt

On Mon, Feb 9, 2015 at 10:17 AM, karozans <[hidden email]> wrote:
Hi Karl.  Thanks for the reply.  You were right.  I got that working.

However.  I guess I am a little confused on what I should do.

I need to programmatically start adding charts to this border container.
Since I don't know how many charts I will be adding, I want the
BorderContainer to grow as I add Charts to it.  Even if my main page starts
to scroll.

How would I accomplish that?

Thanks



--
View this message in context: http://dojo-toolkit.33424.n3.nabble.com/Dijit-BorderContainer-tp4005283p4005285.html
Sent from the Dojo Toolkit mailing list archive at Nabble.com.
--
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/

[hidden email]
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest


--
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/

[hidden email]
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
Reply | Threaded
Open this post in threaded view
|

Re: Dijit BorderContainer

karozans
This post was updated on .
I am adding them as children of the contentpanes.  Is there no way to expand the BC such that the whole page scrolls instead of just the BC regions?

define(
    [
        "dojo/_base/declare",

        "dijit/layout/BorderContainer",
        "dijit/layout/ContentPane",

        "bennett/Chart"
    ],
    function(
        declare,

        BorderContainer,
        ContentPane,

        Chart)
    {
        var top = null;
        var center = null;
        var bc = null;
        
        var initLayout = function(srcNodeRef)
        {
            // create a BorderContainer as the top widget in the hierarchy
            bc = new BorderContainer(
            {
                design : "headline",
                gutters : true,
                isLayoutContainer : true,
                liveSplitters : false,
                persist : false,
                style : "height: 100%; width: 100%;"
            });
            
            top = new ContentPane(
            {
                region : "top",
                content : "hello world"
            });
            bc.addChild(top);
            
            center = new ContentPane(
            {
                region : "center",
                content : "how are you?"
            });
            bc.addChild(center);

            bc.placeAt(srcNodeRef);
        };

        var initProxyChart = function()
        {
            var chart = new Chart(
            {
                chartTitle : "Proxy",
                sliceTitles : ["Proxied", "Not Proxied"],
                sliceValues : [50, 246],
                sliceFilters : ["1,2,3,5", "_,-,0,4"],
                columnData : "WS_REVERSE_PROXIED",
                legendBool : true
            });
            
            center.addChild(chart);
            bc.startup();
            bc.resize();            
        };

        return declare(
            null,
            {
                constructor : function(args, srcNodeRef)
                {
                    declare.safeMixin(this, args);

                    initLayout(srcNodeRef);
                    initProxyChart();
                }
            });
    });