This is a migrated thread and some comments may be shown as answers.

How to adjust size of grid within a splitter

1 Answer 230 Views
Splitter
This is a migrated thread and some comments may be shown as answers.
Galen Giebler
Top achievements
Rank 1
Galen Giebler asked on 24 May 2013, 11:02 PM
 I am using the ASP.NET MVC server side wrappers to create a page with a splitter control with 3 horizontal panes.  Each pane includes a single <div> with header text, and a Kendo Grid.

How do I get the grid to resize appropriately within each pane?
I have tried the following, but the splitterPane.scrollHeight value does not seem correct when the pane gets smaller.  For example, when the page starts all panes report a scrollHeight of 278, but if I move the top splitter up, the scrollheight of the top pane goes to up to 280 instead of being reduced..
I have tried to find another property/method other than scrollHeight and have been unsuccessful..
Any help is greatly appreciated!!!
function LayoutChange() {
    UpdateGridSize("#PendingVessels", 0);
    UpdateGridSize("#DueToSellVessels", 1);
    UpdateGridSize("#DueToShiftVessele", 2);
}
 
function UpdateGridSize(gridName, indexPane) {
    var splitter = $("#Main");
    var splitterPane = splitter.find(".k-pane")[indexPane];
    var splitterHeight = splitterPane.scrollHeight;
 
    var gridElement = $(gridName),
        dataArea = gridElement.find(".k-grid-content"),
        //gridHeight = gridElement.innerHeight(),
        otherElements = gridElement.children().not(".k-grid-content"),
        otherElementsHeight = 0;
    otherElements.each(function () {
        otherElementsHeight += $(this).outerHeight();
    });
 
    gridElement.height(splitterHeight - 25);  //-25 for the header item
    dataArea.height(gridElement.innerHeight() - otherElementsHeight);
}

1 Answer, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 27 May 2013, 07:46 AM
Hi Galen,

If you want the Grids to resize in such a way, so that the Splitter panes are not scrollable, then you should measure offsetHeight instead of scrollHeight.

Regards,
Dimo
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Splitter
Asked by
Galen Giebler
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Share this question
or