If it has Scroll Y and Collapse it fully expands then shrinks.

If it has Scroll Y and Collapse it fully expands then shrinks.

Godrules500Godrules500 Posts: 25Questions: 13Answers: 0
edited July 2015 in Free community support

I have a Jquery Datatable that I am using with ScrollY being 500px and scrollCollapse being true. Both settings individually are working great. However, when the table is first created it is fully expanding to the 500px max height and then shrinking in size after the rows are added. Is there anyway to prevent it from showing the max height and then shrinking and have it only open to calculated height to begin with?

Reason why is it looks poor and is very frustrating to see the page jumping around when it shouldn't be.

Answers

  • Godrules500Godrules500 Posts: 25Questions: 13Answers: 0

    Any one have an answer here? Really could use some help :)

  • tangerinetangerine Posts: 3,365Questions: 39Answers: 395

    Please provide a link to a test page showing the problem as required by the forum rules.

    http://datatables.net/forums/discussion/12899/post-test-cases-when-asking-for-help-please-read

  • allanallan Posts: 63,691Questions: 1Answers: 10,500 Site admin

    However, when the table is first created it is fully expanding to the 500px max height

    Does the table have rows in it at that point? Also what version of DataTables are you using. As tangerine notes, please provide a link to a test case.

    Allan

  • Godrules500Godrules500 Posts: 25Questions: 13Answers: 0

    I am using jquery datatables 1.10.7 but have noticed this issue from the beginning.

    It does not have any rows at that point allan. It is opening up a blank 500px height jquery datatable box that has processing inside. Then once the rows are generated it is collapsing to the perfect height.

    I'll try to get a test page setup and will post here if I can.

  • Godrules500Godrules500 Posts: 25Questions: 13Answers: 0

    I am trying to create a test case but because it loads immediately I am not able to reproduce the issue I'm having. I am running using ajax and so it might have a second to load.

     tblShowRMasterList = $('#tblShowRMasterList').DataTable({
                "scrollY": "auto",
                "scrollX": "100%",
                "scrollCollapse": true,
                "bSort": false,
                "bFilter":false,
                "bLengthChange": false,
                "bAutoWidth": true,
                "serverSide": true,
                "processing": true,
                "destroy": true,
                "sAjaxSource": {
                    "url": "@Url.Action("DisplayRMasters", "Receipts")",
                    "type": "POST",
                }
    ......other stuff here......
    })
    
  • allanallan Posts: 63,691Questions: 1Answers: 10,500 Site admin

    Hi,

    I'm afraid that without a test case there is little help we can offer. This doesn't sound like an issue I've come across before so I'm not immediately sure what to suggest.

    Allan

This discussion has been closed.