can't initiate with aoColumns and mData
can't initiate with aoColumns and mData
yee379
Posts: 6Questions: 0Answers: 0
i have the following code:
[code]
device
[/code]
[code]
(function() {
jQuery(function() {
$('.datatables').dataTable({
bProcessing: true,
aaData: [
{
"device": "one"
}, {
"device": "two"
}, {
"device": "three"
}
],
aoColumns: [
{
mData: "device",
sDefaultContent: "-"
}
]
});
});
}).call(this);
[/code]
but i can't get it to work! i see that it shows the correct number of rows (3), but the content is all '-' (from sDefaultContent). if i remove the sDefaultContent, then i get
[quote]
DataTables warning (table id = 'DataTables_Table_0'): Requested unknown parameter '0' from the data source for row 0
[/quote]
i'm using 1.9.2.
(sorry i can't use the debugger, all my stuff is on the intranet here)
[code]
device
[/code]
[code]
(function() {
jQuery(function() {
$('.datatables').dataTable({
bProcessing: true,
aaData: [
{
"device": "one"
}, {
"device": "two"
}, {
"device": "three"
}
],
aoColumns: [
{
mData: "device",
sDefaultContent: "-"
}
]
});
});
}).call(this);
[/code]
but i can't get it to work! i see that it shows the correct number of rows (3), but the content is all '-' (from sDefaultContent). if i remove the sDefaultContent, then i get
[quote]
DataTables warning (table id = 'DataTables_Table_0'): Requested unknown parameter '0' from the data source for row 0
[/quote]
i'm using 1.9.2.
(sorry i can't use the debugger, all my stuff is on the intranet here)
This discussion has been closed.
Replies
Allan