Problem to displaying all columns with sScrollX

Problem to displaying all columns with sScrollX

rMz44rMz44 Posts: 8Questions: 0Answers: 0
edited August 2013 in DataTables 1.9
Hi All,

I've a problem with my datatable and particularly with the sScrollX.

My datatable counts 62 colums and don't display all of these,

the sScrollX bar appear but all the columns cannot be showed, even if i scrolled to the end.
In Addition, the data are in wrong columns .

Without the scrollX, all data are in the rights columns but a part of the datatable displaying out of my screen for sure.

That i want, it's to display all these columns with her right data, and with the scrollX bar working.

Can anyone help me to solve this problem?

This is my code :

[code]
var myGrid = $(idTable).dataTable({
"sDom": "<'row'<'span6'l><'span6'f>><'span6'i>>>",
"sPaginationType": "bootstrap",
"sScrollY": '130px',
"sScrollX": '100%',
"sScrollXInner": '1920px'
});
var settings = myGrid.fnSettings();
var heightpage = function() {
var offsetgrid = $(idTable + '_wrapper .dataTables_scrollBody').offset().top;
var windowheight = $(window).height();
var windowwidth = $(window).width();
var heightrow = $(idTable + '_wrapper .dataTables_scroll + .row').outerHeight();
var offsetgridnew = windowheight - (offsetgrid + heightrow);

$(idTable + '_wrapper .dataTables_scrollBody').height(offsetgridnew);
$(idTable + '_wrapper .dataTables_scrollHead').width(windowwidth);
$(idTable + '_wrapper .dataTables_scrollBody').width(windowwidth);
}
$(window).resize(heightpage);
heightpage(idTable);

}
[/code]

Replies

  • allanallan Posts: 61,431Questions: 1Answers: 10,048 Site admin
    Please link to a test case: http://datatables.net/forums/discussion/12899/post-test-cases-when-asking-for-help-please-read .

    Also I would suggest not using sScrollXInner . Remove it and let the table auto size.

    Allan
  • rMz44rMz44 Posts: 8Questions: 0Answers: 0
    Hi Allan,

    Thanks for your response, i don't resolve my bug for today :(

    i give you a link to a screenshot of my datatable, i've a misalignment in my column and problem with my sScrollX, if you have an idea? i delete the sScrollXInner but it don't resolve it.

    http://hpics.li/08520cd

    Thanks a lot!
  • allanallan Posts: 61,431Questions: 1Answers: 10,048 Site admin
    We'd need a link to a test case.

    Allan
  • allanallan Posts: 61,431Questions: 1Answers: 10,048 Site admin
    Also try calling fnAdjustColumnSizing .

    Allan
  • rMz44rMz44 Posts: 8Questions: 0Answers: 0
    So, i tried with your link and it work..

    http://live.datatables.net/etorur/2/edit

    But not in my website :/, i don't know where is the problem.

    Here the code of my table :

    [code]



    $(document).ready(function() {
    datatables('#operator-table');
    });
    var RefreshGridID = "<%= this.upDevicesGrid.ClientID %>";










    <%=Resources.Res.Grid_InsertNewOne%>
    |

    <%=Resources.Res.Grid_RemoveSelection%>
    |

    <%=Resources.Res.Msg_Refresh%>

    <%=Resources.Res.Columns_SavePref%>
    |
    <%=Resources.Res.Device_Filters%>
    |
    <%=Resources.Res.Device_Export_CSV%>








    ...
    ...




    ...






    [/code]
  • rMz44rMz44 Posts: 8Questions: 0Answers: 0
    i don't write all the code for sure, all the tag are closed !
  • rMz44rMz44 Posts: 8Questions: 0Answers: 0
    Hi Allan, do you have a solution or not?
  • allanallan Posts: 61,431Questions: 1Answers: 10,048 Site admin
    Without a test case, i can't really say. All I can assume is that the table is initially hidden. Call the fnAdjustColumnSizing function when it is made visible.

    Allan
  • rMz44rMz44 Posts: 8Questions: 0Answers: 0
    Hi, I just link you the test case in one of my responses earlier.

    http://live.datatables.net/etorur/2/edit

    In addition i gived you a part of my code.

    Rémy
  • rMz44rMz44 Posts: 8Questions: 0Answers: 0
    Hi Allan,

    I link you the test case, the post just before,

    Rémy
  • allanallan Posts: 61,431Questions: 1Answers: 10,048 Site admin
    You've got it setting the width of the container. Without those lines it seems to operate as I'd expect: http://live.datatables.net/etorur/3/edit . What is the intention of those lines of code?

    Allan
  • rMz44rMz44 Posts: 8Questions: 0Answers: 0
    Many thanks to you for your help, i just have a conflict with my css.......

    Rémy
This discussion has been closed.