oSettings.aoColumns[i] is undefined
oSettings.aoColumns[i] is undefined
codemonk
Posts: 24Questions: 0Answers: 0
Hello everyone, I have changed my development environment , and have migrated my work over to my server. I've already had many issues with my REST web-service which i have hopefully fixed. In any case, This was created using datatables 1.9.1 and jquery-ui 1.8.2. I am now using datatables 1.9.4 and jquery-ui 1.9.2. And this is the error im getting (it get triggered when you edit a row)
[code]
TypeError: oSettings.aoColumns[i] is undefined
[Break On This Error]
var col_id = oSettings.aoColumns[i].sTitle;
[/code]
please take a look at it. all the code is available under the source HTML, however for easy access here is my code:
[code]
//Sets Selected Row
var SelectedRow = fnGetSelected(oTable);
if(SelectedRow.length !== 0 ) {
var col_name = [];
var row_sel = oTable.fnGetData(SelectedRow[0]);
var oSettings = oTable.fnSettings();
console.log(oSettings.aoColumns);
//Grabs Column Names
for(var i=0; i
[code]
TypeError: oSettings.aoColumns[i] is undefined
[Break On This Error]
var col_id = oSettings.aoColumns[i].sTitle;
[/code]
please take a look at it. all the code is available under the source HTML, however for easy access here is my code:
[code]
//Sets Selected Row
var SelectedRow = fnGetSelected(oTable);
if(SelectedRow.length !== 0 ) {
var col_name = [];
var row_sel = oTable.fnGetData(SelectedRow[0]);
var oSettings = oTable.fnSettings();
console.log(oSettings.aoColumns);
//Grabs Column Names
for(var i=0; i
This discussion has been closed.
Replies
Allan
UPDATE: after poking around some more i noticed,
[code] var row_sel = oTable.fnGetData(SelectedRow[0]);[/code]
This returns the 2 more than it should. Which is very odd. If i have 3 rows, which in this case i do, it returns 3 rows, and 2 null rows. any ideas? Ive added some console.logs for debugging.
It looks like it is coming from your server-side processing script:
[code]
{
"sEcho": 1,
"iTotalRecords": "1",
"iTotalDisplayRecords": "1",
"aaData": [
[1, "Testing", 1, "Yes", null, null]
]
}
[/code]
is the return I get on load.
The DataTable appears to only have 4 columns defined, so DataTables is ignoring the two two entries in the array (the two nulls).
Allan