How to set data option in initialization?
How to set data option in initialization?
New to dataTable. I am trying to run a sample from section "Javascript sourced data". I just
but always got error in chrome.
Uncaught TypeError: Cannot read property 'asSorting' of undefined'.
Here is the simple java script (listed a few rows from sample itself in dataSet):
var dataSet = [
['Trident','Internet Explorer 4.0','Win 95+','4','X'],
['Trident','Internet Explorer 5.0','Win 95+','5','C'],
['Trident','Internet Explorer 5.5','Win 95+','5.5','A'],
['Trident','Internet Explorer 6','Win 98+','6','A'],
];
$(document).ready(function() {
$('#demo').html( '<table cellpadding="0" cellspacing="0" border="0" class="display" id="example"></table>' );
$('#example').dataTable( {
"data": dataSet,
"columns": [
{ "title": "Engine" },
{ "title": "Browser" },
{ "title": "Platform" },
{ "title": "Version", "class": "center" },
{ "title": "Grade", "class": "center" }
]
} );
} );
in a javascript. declared dataSet as a global variable. and i have checked dataSet has all the values. Please help what I have done wrong. the only thing works is zero configuration example.
Thanks
Answers
root cause found. it is a version problem. after download the latest dataTable js. it worked.