ParamQuery grid support forum

General Category => Help for ParamQuery Pro => Topic started by: marco.fuhrmann on April 01, 2015, 05:24:44 pm

Title: Set css margin when Grid is maximized
Post by: marco.fuhrmann on April 01, 2015, 05:24:44 pm
Quote
css is an object containing css rules which are applied to grid in maximized state.

If i try to set the margin like
Quote
$("#evnTabelle").pqGrid({ collapsible: { css: { margin: 50 } } });
the table has only top and left a margin. The right and bottom side of the maximized Grid is cutted.
How can i set the right and bottom margin when the Grid is maximized?
Title: Re: Set css margin when Grid is maximized
Post by: paramvir on April 01, 2015, 09:13:46 pm
For the required effect, you have to adjust height and width of grid in toggle event.

Code: [Select]
            collapsible: {
                css: {
                    margin: 50
                }
            },
            toggle: function (evt, ui) {
                if (ui.state == 'max') {
                    $(this).pqGrid('option', {
                        height: '100%-102',
                        width: '100%-102'
                    });
                }
            },

Please see this example:

http://jsfiddle.net/g6gL4mzz/