Problem to displaying all columns with sScrollX
Problem to displaying all columns with sScrollX
rMz44
Posts: 8Questions: 0Answers: 0
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]
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]
This discussion has been closed.
Replies
Also I would suggest not using sScrollXInner . Remove it and let the table auto size.
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!
Allan
Allan
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]
Allan
http://live.datatables.net/etorur/2/edit
In addition i gived you a part of my code.
Rémy
I link you the test case, the post just before,
Rémy
Allan
Rémy