dataTables resize height

dataTables resize height

oscaroxyoscaroxy Posts: 9Questions: 0Answers: 0

when I change the dimension of div that contain the dataTable I would to change the height the dataTable, it's scrollY=true.
thanks

Replies

  • oscaroxyoscaroxy Posts: 9Questions: 0Answers: 0

    I solved:

    $(window).load(function(){
    $(".resizable").on("mresize",function(){
    var h = parseInt(($('#bx-result-list').css('height')).replace('px','')) - 40;
    $('#tbAnagraficaCv_wrapper .dataTables_scrollBody').css("height",h+"px").css("max-height",h+"px");
    $('#tbAnagraficaCv').dataTable().fnDraw(false);
    });
    });

    WHERE:

  • allanallan Posts: 61,864Questions: 1Answers: 10,136 Site admin

    Hi,

    Thanks for posting back with your solution. That looks like a good way to do it at the moment (since DataTables currently doesn't have an API method for this).

    Allan

This discussion has been closed.