Any limited criteria for column
Any limited criteria for column
karnesh141
Posts: 4Questions: 0Answers: 0
I have gone through my code. when create Datatable with 7 column, it's not showing any error. if i show data in 8 column then it show error.
Error is : DataTables warning (table id = 'example'): Requested unknown parameter '0' from the data source for
[code]
function onSuccess(result) {
var prod = eval("(" + result + ")");
if (prod.length > 0) {
var regList = new Array(7);
for (var i = 0; i < prod.length; i++) {
regList[i] = new Array(7);
regList[i][0] = prod[i].Name;
regList[i][1] = prod[i].ContactNumber;
regList[i][2] = prod[i].RegistrationNumber;
regList[i][3] = prod[i].BankName;
regList[i][4] = prod[i].BankReferenceNumber.replace("Reference No (In case of netbanking)", "");
regList[i][5] = prod[i].AmountDepositied;
regList[i][6] = prod[i].DepositeDate;
regList[i][7] = prod[i].PaymentMode;
/*regList[i][8] = prod[i].Attachment;*/
}
$('#dynamic').html('');
$('#example').dataTable({
"aaData": regList,
"sPaginationType": "full_numbers",
"aoColumns": [
{ "sTitle": "Name", "bSortable": false },
{ "sTitle": "Contact Number", "bSortable": false },
{ "sTitle": "Registration", "bSortable": false },
{ "sTitle": "Bank Name", "bSortable": false },
{ "sTitle": "Bank Ref No", "bSortable": false },
{ "sTitle": "Amount", "bSortable": false },
{ "sTitle": "Date", "bSortable": false },
{ "sTitle": "Payment Mode", "bSortable": false },
/*{ "sTitle": "Receipt", "bSortable": false },*/
]
});
}
$("#loading").css('display', 'none');
}
[/code]
Error is : DataTables warning (table id = 'example'): Requested unknown parameter '0' from the data source for
[code]
function onSuccess(result) {
var prod = eval("(" + result + ")");
if (prod.length > 0) {
var regList = new Array(7);
for (var i = 0; i < prod.length; i++) {
regList[i] = new Array(7);
regList[i][0] = prod[i].Name;
regList[i][1] = prod[i].ContactNumber;
regList[i][2] = prod[i].RegistrationNumber;
regList[i][3] = prod[i].BankName;
regList[i][4] = prod[i].BankReferenceNumber.replace("Reference No (In case of netbanking)", "");
regList[i][5] = prod[i].AmountDepositied;
regList[i][6] = prod[i].DepositeDate;
regList[i][7] = prod[i].PaymentMode;
/*regList[i][8] = prod[i].Attachment;*/
}
$('#dynamic').html('');
$('#example').dataTable({
"aaData": regList,
"sPaginationType": "full_numbers",
"aoColumns": [
{ "sTitle": "Name", "bSortable": false },
{ "sTitle": "Contact Number", "bSortable": false },
{ "sTitle": "Registration", "bSortable": false },
{ "sTitle": "Bank Name", "bSortable": false },
{ "sTitle": "Bank Ref No", "bSortable": false },
{ "sTitle": "Amount", "bSortable": false },
{ "sTitle": "Date", "bSortable": false },
{ "sTitle": "Payment Mode", "bSortable": false },
/*{ "sTitle": "Receipt", "bSortable": false },*/
]
});
}
$("#loading").css('display', 'none');
}
[/code]
This discussion has been closed.
Replies
Allan
Before loading data show error message. and showing empty row also.
Link is here.
http://dreamjeenew.mysociety.co.in/testingpurpose.aspx
please give response as soon as possible with solution.