Horizontal scroll bar in a dynamic table will not appear
Horizontal scroll bar in a dynamic table will not appear
dsmith505
Posts: 2Questions: 0Answers: 0
I have a dynamic table that works with a varying number of columns and data values. I am doing this in a "What if" scenario that the data returned varies as the user selects columns to view. As long as the number of data values in each row matches the number of columns in the header it displays. The problem I am having is that I can't get the horizontal bar to appear no matter what I use for sScrollx and sScrollXInner. As columns are added to the display, they just get narrower. Is there a way to make the scroll bar show up in these circumstances? Can the columns be made a fixed length (no matter the number of columns) that once a certain number of columns is exceeded the scroll bar appears?
Here is how I have it set up in the JSP:
Query Results
var dataVar = <%= viewerData %>;
var colNames = <%= columnNames %>;
$(document).ready(function() {
$('#exampleTable').dataTable({
sPaginationType:"full_numbers",
bJQueryUI: true,
bScrollAutoCss: true,
aoColumns: colNames,
aaData: dataVar,
bScrollCollapse: true,
sScrollx: "100%",
sScrollXInner: "600%"
});
} );
where the view data is a string that looks like: [["val1", "val2", "val3"],["val1a", "val2a", "val3a"]]"
and the columnNames looks like [{sTitle:"col1"},{sTitle:"Col2"},{sTitle:"Col3"}]
Here is how I have it set up in the JSP:
Query Results
var dataVar = <%= viewerData %>;
var colNames = <%= columnNames %>;
$(document).ready(function() {
$('#exampleTable').dataTable({
sPaginationType:"full_numbers",
bJQueryUI: true,
bScrollAutoCss: true,
aoColumns: colNames,
aaData: dataVar,
bScrollCollapse: true,
sScrollx: "100%",
sScrollXInner: "600%"
});
} );
where the view data is a string that looks like: [["val1", "val2", "val3"],["val1a", "val2a", "val3a"]]"
and the columnNames looks like [{sTitle:"col1"},{sTitle:"Col2"},{sTitle:"Col3"}]
This discussion has been closed.