Adminlte: sidebar not till its full height

Created on 21 Aug 2015  路  11Comments  路  Source: ColorlibHQ/AdminLTE

the sidebar is not getting displayed to full height.
screenshot from 2015-08-20 16 24 33

question

All 11 comments

Hello,
It may be easier for us to help you if you give us access to the page. I can't determine the issue just from a screenshot.

Thanks!

I'm having the same problem.When I resize the window by double clicking the title bar the sidebar height is incorrect and I've been trying all day to fix it but still no luck! :(
image

@niks-codificador Did you fix it?

@FalconDev91 not yet. Even I banged my head to get it fixed.

@FalconDev91 I figured the error out. Yeah it quite late, like after months.
Put sidebar code in wrapper class. See below

Hope it helps you. it helped me. Thanks @almasaeed2010 for this amazing template.

I'm still having this issue on 2.3.3, putting the sidebar in wrapper class does not work for me:

screen shot 2016-06-02 at 23 11 13

Share your code so that I could help you with!

I managed to do it using jQuery. Simply get the height of the current document once it is loaded and then assign that height to the sidebar.

jQuery(document).ready(function($){ $('.main-sidebar').height($(document).outerHeight()); });

In my case the sidebar has a class of main-sidebar. You can change it to your value.

@nikhilshirsath1993 did you fix it?

I know this is an old thread, but just in case someone else comes across it. I found the problem was that if the page dynamically changes height (say an ajax table loading) then the main-sidebar doesn't adjust it's height. So I took andresbello's solution a step further and watch for document height changes and then adjust the sidebar height appropriately:

    function onElementHeightChange(elm, callback) {
        var lastHeight = elm.clientHeight, newHeight;
        (function run() {
            newHeight = elm.clientHeight;
            if (lastHeight != newHeight)
                callback();
            lastHeight = newHeight;

            if (elm.onElementHeightChangeTimer)
                clearTimeout(elm.onElementHeightChangeTimer);

            elm.onElementHeightChangeTimer = setTimeout(run, 200);
        })();
    }


    onElementHeightChange(document.body, function () {
        //alert('Body height changed');
        $('.main-sidebar').height($(document).outerHeight());
    });

aside class="main-sidebar sidebar-dark-primary elevation-4" style="margin-top:0px;"

I add this : style="margin-top:0px;"
to my aside element
on angular 8
funciono para mi

works for me.
image

Was this page helpful?
0 / 5 - 0 ratings

Related issues

EliuTimana picture EliuTimana  路  4Comments

frlinw picture frlinw  路  3Comments

RaruRv picture RaruRv  路  3Comments

riklaunim picture riklaunim  路  3Comments

esaesa picture esaesa  路  3Comments