Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

100% Height in dGrid

Tags:

dojo

dgrid

How is it possible to make a dGrid instance take up 100% of the height of its container? I can use CSS to make the ".dgrid" classed div a specific height but when I set it to 100% it doesn't display.

like image 876
voidstate Avatar asked Jan 11 '13 10:01

voidstate


2 Answers

Got it.

.dgrid {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    height: auto;
}

(With position absolute/relative on container, of course)

like image 74
voidstate Avatar answered Sep 23 '22 02:09

voidstate


I think the supported way to do this is with the .dgrid-autoheight css class.

        require([
            "dgrid/List",
            "dgrid/OnDemandGrid",
            "dgrid/Selection",
            "dgrid/Keyboard",
            "dojo/_base/declare",
            "dgrid/test/data/createAsyncStore",
            "dgrid/test/data/smallColorData",
            "dojo/domReady!"
        ], function(List, Grid, Selection, Keyboard, declare, createAsyncStore, smallColorData){
                window.grid = new (declare([Grid, Selection, Keyboard]))({
                    className: "dgrid-autoheight",
                    collection: createAsyncStore({ data: smallColorData }),
                    columns: {
                        col1: "Color",
                        col5: "R",
                        col6: "G",
                        col7: "B"
                    }
                }, "grid");
            });

This is from the test examples.

like image 26
Steve Avatar answered Sep 20 '22 02:09

Steve