Datatables warning (tableid=’MasterTable’): Requested unknown parameter ‘AreaId’ from the datasource

Datatables warning (tableid=’MasterTable’): Requested unknown parameter ‘AreaId’ from the datasource

shailyshaily Posts: 8Questions: 0Answers: 0
edited June 2012 in DataTables 1.9
i am using datatables 1.9.1 .

i am able to find 2 columns ,but for last column i am getting this error "Datatables warning (tableid=’MasterTable’): Requested unknown parameter ‘AreaId’ from the datasource "

this is my javascript file

var oTable_Common_Areas;
var jsonParse = [];
var AreaList = new Array();

$(document).ready(function () {
$("#btngetareas")
.click(function () {
debugger;

GetCommon_Areas();
LoadDataTable();
});
});


function LoadDataTable() {
return $("#MasterTable").DataTable({
"sDom": 'T<"clear">lfrtip',
"oTableTools": {
"sSwfPath": "../../Images/copy_cvs_xls_pdf.swf"
},
"aoColumns": [
{"mDataProp": "CityID" },
{ "mDataProp": "AreaName" },
{ "mDataProp": "AreaID" }
],
"aaData": AreaList
});
}

function GetCommon_Areas() {


$.ajaxSetup({ async: false });
$.post("../Home/GetArea", {}, function (Data) {

AreaList = eval(Data);
debugger;
});
debugger;

$.ajaxSetup({ async: true });

}


where GetArea function is returning string which is in json format.For AreaName of AreaList , i am getting error that children could not be evaluated , although i am getting value of Areaname of Arealist properly.



***********************************

this is my .aspx file

<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">












ResultView













CityID
AreaName
AreaID









****************************
please expert help me out to solve this problem.

this is my datatablesdebugger link: http://debug.datatables.net/obaduf

Replies

  • allanallan Posts: 63,397Questions: 1Answers: 10,451 Site admin
    http://datatables.net/faqs#unknown_parameter - please give us a link or run the table through the debugger.

    Allan
  • shailyshaily Posts: 8Questions: 0Answers: 0
    please help me out because i have stucked at this point
  • shailyshaily Posts: 8Questions: 0Answers: 0
    please help me out to find that where i am going wrong.Still i am stucked at this point
  • koosvdkolkkoosvdkolk Posts: 169Questions: 0Answers: 0
    [code]"aoColumns": [
    {"mDataProp": "CityID" },
    { "mDataProp": "AreaName" },
    { "mDataProp": "AreaID" }
    ],[/code]

    [quote]where GetArea function is returning string which is in json format.For AreaName of AreaList [/quote]

    1. Could you give the JSON string?
    2. Should it not contain AreaID, as you define that column?
  • allanallan Posts: 63,397Questions: 1Answers: 10,451 Site admin
    In your init you have:

    > AreaID

    and in your data you have:

    > AreaId

    Allan
  • allanallan Posts: 63,397Questions: 1Answers: 10,451 Site admin
    heh - good timing :-)
  • deandean Posts: 2Questions: 0Answers: 0
    Your request go to "../Home/GetArea" page.So you can find that 'AreaId' whether exsit 'AreaId' variable.May be 'AreaId' is written for 'areaId' in "../Home/GetArea" page.You must ensure displayed
    page's variable the same as requested page's variable .
This discussion has been closed.