Datatables_scrollheadinner set to a ridiculous amount

Datatables_scrollheadinner set to a ridiculous amount

reiphilreiphil Posts: 3Questions: 0Answers: 0
edited December 2011 in General
Hello All,

I am having an issue in which the property datatables_Scrollheadinner is getting set to some exemplary size. However, if i click to sort on one of the headers, the data snaps back to the size it should be.

Examining under developer's console in Chrome:
http://i.imgur.com/zgyxi.jpg

Example of issue:
http://i.imgur.com/KkNV4.jpg

Snap back:
http://i.imgur.com/c6z2H.jpg

The table is configured with the following options:
"bJQueryUI": true,
"aaSorting": [[0, "desc"]],
"aoColumns": aoColumns,
"bStateSave": false,
"iDisplayStart": 0,
"sScrollY": "400px",
"bPaginate": false,
"bAutoWidth": true

Any ideas?

Thanks,
Phil

Replies

  • allanallan Posts: 63,542Questions: 1Answers: 10,476 Site admin
    Are you initialising the table inside a hidden element? If so, you will need to call fnAdjustColumnSizing when the table is made visible, since dimensions are not calculated by the browser when the element is not in the document flow.

    Allan
  • reiphilreiphil Posts: 3Questions: 0Answers: 0
    Hi Allan,

    Thanks for your response - however, the table is not inside any hidden element. The page is almost literally .

    The div is set to width 954 (span-16 using blueprint.css), and the table is set to width: 100%, using classes datatable and display.

    In the table header, each column is set to us respectively 20%, 20%, 20%, 20%, 10%, 10% of the width. Each column in the body is set to use the same.

    Please let me know if there is any other information I can provide.

    Thanks,
    Phil
  • allanallan Posts: 63,542Questions: 1Answers: 10,476 Site admin
    If you are able to give me a link to your demo page, that would be really helpful so I can see and debug the live version.

    Allan
  • aouchachachaaouchachacha Posts: 1Questions: 0Answers: 0
    Sorry to up this discussions but the only solution I found is to add this line after creating datatables:

    $('.dataTables_scrollHeadInner,.dataTables_scrollHeadInner table').width(.....);

    That's verry strange because on a same website with the same css for all page, I have the problem for one table but not for all... And the width of the header is different between computer. On my computer I had 1264px but on an other I had highter than 1800px!

    I hope my post will help developpers.
  • allanallan Posts: 63,542Questions: 1Answers: 10,476 Site admin
    Hi,

    If you haven't already, could you try the 1.9.1.dev nightly from the downloads page please? I've made a change in this area which should help with this. If that doesn't help, can you possibly link me to your example please?

    Allan
  • styustyu Posts: 2Questions: 0Answers: 0
    I think I have found the related error. If I set the sScrollInner property to say "100%", then datatables_ScrollHeadInner will be:
    [code][/code]

    if sScrollInner is set to 98px, then the result is:
    [code][/code]

    So the percent is rewritten into px.

    I think this affects bug 3796 as well.
This discussion has been closed.