creating dynamic columns
creating dynamic columns
saravananram
Posts: 1Questions: 0Answers: 0
How to create a dynamic columns along with data in jquery data table.Pls help.
This discussion has been closed.
Replies
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"}]
The problem I have had is getting the horizontal scrolling to work. No matter what vaues I use for xScrollx and sScrollXInner it never displays the horizontal scroll bar. If I add columns it just makes the displayed columns smaller.