Requested unknown parameter 'luser' from the data source

Requested unknown parameter 'luser' from the data source

ablelinkablelink Posts: 6Questions: 0Answers: 0
edited November 2011 in General
I've found similar problems reported on the forum, but I can find nothing wrong.... any ideas would be greatly appreciated!

Here is the data and I'm using sAjaxSource.:
[code]
{"aaData":
[
{
"version": "v3afaZd5",
"luser": "package4@ablelinktech.com",
"key": "addd6e7d-45fd-48e7-bff6-63b192272ede",
"package": "foo",
"channel": "TestIt"
},
{
"version": "v3afaZd5",
"luser": "shane",
"key": "a4a7eeab-da1e-4dcf-915f-9854e796d070",
"package": "foo",
"channel": "TestIt"
}
]
}

[/code]

Here is the Javascript - I'm using aoColumns with mDataProp - as you can see, the property it's looking for (luser) is in the data properly
[code]
addDataTable = function() {
var lTableCfg, updateCustId, url;
url = root.objAddr + 'licenseSetList/' + root.custId;
lTableCfg = {
bProcessing: true,
bFilter: true,
bSort: true,
bPaginate: false,
sPaginationType: "two_button",
sScrollY: "75%",
bScrollInfinite: true,
bJQueryUI: true,
sDom: '<"H"pf>t<"F"ir>',
bScrollCollapse: true,
sAjaxSource: url,
aaSorting: [[0, "asc"]],
aoColumns: [
{
mDataProp: "luser",
bUseRendered: true,
bSortable: true,
sWidth: "33%"
}, {
mDataProp: "package",
bSortable: false,
sClass: "centerMe",
sType: "numeric"
}, {
mDataProp: "channel",
bSortable: false,
sClass: "centerMe",
sType: "numeric"
}, {
mDataProp: "version",
bUseRendered: true,
bSortable: false,
sClass: "centerMe"
}, {
mDataProp: "key",
bUseRendered: true,
bSortable: true,
sClass: "centerMe"
}, {
fnRender: function(oObj) {
var html;
html = '\n Modify\n Delete\n';
return html;
},
bSortable: false,
sWidth: "66px"
}
]

};
[/code]

Replies

  • allanallan Posts: 63,189Questions: 1Answers: 10,412 Site admin
    Perhaps I'm just being daft, but you have DataTables looking for the property "luser" in the data source, but the JSON you posted above doesn't have an "luser" property - hence the error that DataTables is reporting.

    If this isn't what you expected to happen - what did you expect?

    Allan
  • ablelinkablelink Posts: 6Questions: 0Answers: 0
    edited November 2011
    Oh, sorry - They match... I had formatted the json data and had been playing around with the field names to see if the behavior changed with different keys. They are both luser at this point.

    I updated the data above and to match and verified that the code and data above are getting the error I posted about.
  • ablelinkablelink Posts: 6Questions: 0Answers: 0
    Added information: It only give the error for whichever row is the last one - for example, with two rows it says:
    [code]
    DataTables warning (table id = 'licenseTable'): Requested unknown parameter 'luser' from the data source for row 1
    [/code]

    but with 3 rows, it will say "row 2". The data in the first row doesn't get displayed, but the all rows after that do. Here is a screen shot: http://goo.gl/7nkw2
  • ablelinkablelink Posts: 6Questions: 0Answers: 0
    IT turns out it was an error in fnReloadAjax, one that I had modified. SO... not bug at all!
  • allanallan Posts: 63,189Questions: 1Answers: 10,412 Site admin
    Phew - good to hear :-). Thanks for the feedback.

    Allan
This discussion has been closed.