datatables warning(table id='Area table'):Requested unknown parameter 'Category_id' from the data so

datatables warning(table id='Area table'):Requested unknown parameter 'Category_id' from the data so

shailyshaily Posts: 8Questions: 0Answers: 0
edited March 2012 in DataTables 1.9
i am getting this error.

datatables warning(table id='Area table'):Requested unknown parameter 'Category_id' from the data source for row 0

************************************
this is my js file
var AreaList = new Array();
var oTable_Area;
var Id_Area = null;
var UpdateData_Area;
var flag_Area = 0;
var aPos_Area;

var cityList_Area = new Array();
var stateList_Area = new Array();
var countrylist_Area = new Array();
var ArealistAC_Area = new Array();

var arr = new Array();

$(document).ready(function () {


GetArea();
//BindCountries();
LoadCommonDataTable();
oTable_Area = LoadDataTable();
// oTable_Area.fnAddData(arr);
//SearchAC("#AreaTable", ArealistAC_Area);
});



function LoadDataTable() {

return $("#AreaTable").DataTable({
// "sDom": 'T<"clear">lfrtip',
// "oTableTools": {
// "sSwfPath": "../../Images/copy_cvs_xls_pdf.swf"
// },
"aoColumns": [
// { "mDataProp": "Id", "bVisible": false, "bSearchable": false },
// { "mDataProp": "CityId", "bVisible": false, "bSearchable": false },
// { "mDataProp": "StateId", "bVisible": false, "bSearchable": false },
// { "mDataProp": "CountryId", "bVisible": false, "bSearchable": false },
{"mDataProp": "Category_id"},
{ "mDataProp": "Category_name" }
// { "mDataProp": "CityName" },
// { "mDataProp": "StateName" },
// { "mDataProp": "CountryName" }
],
"aaData": AreaList.d
});
}

function GetArea() {

$.ajaxSetup({ async: false });
// $.post("WebForm1.aspx/SelectAllCategory", {}, function (Data) {
// debugger;
// AreaList = eval(Data);
// });
alert("getarea");
$.ajax({
type: "POST",
url: "WebForm1.aspx/SelectAllCategory",
data: "{}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (Data) {
AreaList = eval(Data);
}
});
$.ajaxSetup({ async: true });

Replies

  • allanallan Posts: 63,512Questions: 1Answers: 10,472 Site admin
    Can you use the debugger as suggested here please: http://datatables.net/faqs#unknown_parameter

    Allan
  • shailyshaily Posts: 8Questions: 0Answers: 0
    i am getting datatables debug report like this
    debug code: ulayet

    plz help me out.i am stucked here.

    i am nt finding why datatable is nt binding.

    thanks in advance
  • allanallan Posts: 63,512Questions: 1Answers: 10,472 Site admin
    Your "AreaList.d" list parameter is a string - not an array (it just so happens that the contents of the string are a Javascript array). That's the problem, you need to either eval it, or return a Json array.

    Allan
  • shailyshaily Posts: 8Questions: 0Answers: 0
    hi,

    thanks for your reply.i am new to datatables so i am exactly not getting what you have answered.
    can you please tell me in detail that where i am amking mistake?
  • allanallan Posts: 63,512Questions: 1Answers: 10,472 Site admin
    I don't 100% know because I can't see your server-side script - but as I say, your "array" for aaData is not an array, its a string - that's what the problem is. So whatever is generating your AreaList.d variable should be returning an array, not a string.

    Allan
  • shailyshaily Posts: 8Questions: 0Answers: 0
    hi,

    allan tnx u so much.it is working now by using your solution
This discussion has been closed.