Datatable warning: Requested unknown parameter " for row 0.
Datatable warning: Requested unknown parameter " for row 0.
shubhi03
Posts: 4Questions: 3Answers: 0
Hi, Below is my datatable created by jquery for mobile version. Its last column is textbox. It has total fourcolumns. It is working completely fine. Just It gives datatable warning each time when page loads. Warning is "Datatable warning: Requested unknown parameter " for row 0."
Below is the code:
$('#xs-statement-table').dataTable({
"data": json,
"dom": 't',
"info": false,
"pageLength": 8,
"columns": [
{"data": "statementCode"},
{"data": "dueDate"},
{"data": "statementBalance"},
{"data": ""}
],
"columnDefs": [
{className: "wide100", "targets": [0,1,2,3]},
{
'targets': 0,
'orderable': false,
"fnCreatedCell": function (nTd, sData, oData, iRow, iCol) {
$(nTd).html('<p class="bold">Statement</p>'+sData);
}
},
{
'targets': 1,
'orderable': false,
"fnCreatedCell": function (nTd, sData, oData, iRow, iCol) {
$(nTd).html('<p class="bold">Due Date</p>'+date);
}
},
{
'targets': 2,
'orderable': false,
"fnCreatedCell": function (nTd, sData, oData, iRow, iCol) {
$(nTd).html('<p class="bold">Total Due</p><span>$'+sData+'</span>');
}
},
{
'targets': 3,
'searchable':false,
'orderable':false,
"fnCreatedCell": function (nTd, sData, oData, iRow, iCol) {
$(nTd).html('<span class="bold">Payment Amount</span> <span class="dollar-font-xs">$<input type="number" class="payment-xs" min="0" max="100000" step="any" maxlength="9" value="" name="payment-textbox" placeholder="--"/></span>');
}
}
]
}); //End of datatable function
And this is my HTML code:
<table id="xs-statement-table" class="wide100 pointer hideClass">
<thead>
<tr>
<th id="xs-stmt-column" class="black white-active-bg pad-bottom-0-5 width-6-75">Statement</th>
<th id="due-date-xs" class="black white-active-bg pad-bottom-0-5 width-6-75">Due Date</th>
<th id="total-due-xs" class="black white-active-bg pad-bottom-0-5 width-6-75">Total Due</th>
<th id="pay-amt-xs" class="black white-active-bg pad-bottom-0-5 width-6-75">Payment Amount</th>
</tr>
</thead>
</table>
Any suggestion on this?
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
That seems odd, and I don't think is valid. You should use
null
for this column's data property and set defaultContent of an empty string.Allan
Thank you..it worked