Author Topic: Set css margin when Grid is maximized  (Read 2239 times)

marco.fuhrmann

  • Pro Deluxe
  • Newbie
  • *
  • Posts: 6
    • View Profile
Set css margin when Grid is maximized
« 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?

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6313
    • View Profile
Re: Set css margin when Grid is maximized
« Reply #1 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/
« Last Edit: April 01, 2015, 09:18:20 pm by paramquery »