Issues with sScrollX and sScrollXinner

Issues with sScrollX and sScrollXinner

jhuber151jhuber151 Posts: 5Questions: 0Answers: 0
edited August 2012 in General
I have been building a table dynamically. I am not always sure with how many columns or the size of each one. Everything worked fine until i had to put horizontal scrolling in it. This is my initialization
[code]
var oTable = table.dataTable({
"sDom": 'Rt',
"bJQueryUI": true,
"bPaginate": false,
"sScrollX": width,
"sScrollXInner": "110%"
});
[/code]
Width is found to the amount of room i have available to place the table.
This works fine for the larger tables, but if the table can fit in the screen it still gives the horizontal scroll bar due to the sScrollXinner.
Now if i do this:
[code]
var oTable = table.dataTable({
"sDom": 'Rt',
"bJQueryUI": true,
"bPaginate": false,
"sScrollX": width,
});
[/code]

The smaller tables work fine but then the larger tables dont scroll, and they also add new line characters in the larger headers to allow them to fit in the width i have available. Is there any way around this?

Replies

  • JimmiJimmi Posts: 6Questions: 0Answers: 0
    edited September 2012
    I have just the same problem as u described.
    Are there any solution to this? are there any way to set sScrollXInner on runtime?

    Best regards!
  • JimmiJimmi Posts: 6Questions: 0Answers: 0
    Ah, i got it working by using the function mentioned in
    http://datatables.net/forums/discussion/6780/created-a-new-functionlity-to-update-the-sscrollxinner-setting-of-the-table/p1
  • tristanvanbokkemtristanvanbokkem Posts: 19Questions: 0Answers: 0
    edited February 2013
    The above solution is not working for me? DT 1.9.4. When I deselect all columns except 2 it still has an width of 110%, and thus I can scroll with 2 columns (which easily should fit inside the table).

    Using:
    "sScrollX": "100%",
    "sScrollXInner": "110%",

    [edit]

    seems to work when I remove "sScrollXInner"..
This discussion has been closed.