targets as a string not working?
targets as a string not working?
jmarcv
Posts: 1Questions: 4Answers: 0
http://apptest.sellersourcebook.com/members/wsb/dt1.html
TH elements assigned a class, targets refers to the class.
pretty sure this is basically right out of the docs.
What am I doing wrong?
FireBug:
TypeError: col is undefined
if ( col.mData === i ) {
jquery....bles.js (line 6429)
<table id=example>
<tr>
<TH class='c1'>1 ---</TH>
<TH class='c2'>2 ---</TH>
<TH class='c3'>3 ---</TH>
<TH class='c4'>4 ---</TH>
</tr>
</table> <hr>
<script>
data=[
{
"name": "Tiger Nixon",
"position": "System Architect",
"salary": "3120",
"start_date": "2011/04/25",
"office": "Edinburgh",
"extn": "5421"
},
{
"name": "Garrett Winters",
"position": "Director",
"salary": "5300",
"start_date": "2011/07/25",
"office": "Edinburgh",
"extn": "8422"
}
]
$("#example").DataTable( {
data: data,
columnDefs: [
{ "data": "name",targets": "c1" },
{ "data": "position" ,targets": "c4"},
{ "data": "salary" ,"targets": "c2"},
{ "data": "office" ,"targets": "c3"}
]
} );
This discussion has been closed.