struggling to update a row
struggling to update a row
I've been wrestling with this all day. I'm trying to update a row, but all the new values are put in the first cell of the row like I'm updating a single cell. Here's my table definition:
[code]
var oDataTable = $('#reporttable').dataTable({
'aaSorting': [[0, 'asc']],
'aLengthMenu': [10, 25, 50, 100],
'iDisplayLength': 10,
'bJQueryUI': true,
'bRetrieve': true,
'sPaginationType': 'full_numbers',
'aoColumnDefs': [{
'bSortable': false,
'aTargets': [1, 20]
}],
'aoColumns': [
{'mData': 0},
{
'mData': null,
'sDefaultContent': printIcon + ' ' + editIcon
},
{'mData': 1}, {'mData': 2}, {'mData': 3}, {'mData': 4}, {'mData': 5},
{'mData': 6}, {'mData': 7}, {'mData': 8}, {'mData': 9}, {'mData': 10},
{'mData': 11}, {'mData': 12}, {'mData': 13}, {'mData': 14}, {'mData': 15},
{'mData': 16}, {'mData': 17}, {'mData': 18}, {'mData': 19}
]
});
[/code]
Here's the "success" portion of the Ajax call:
[code]
success: function(results) {
var data = $.parseJSON(results);
var pos = oDataTable.fnGetPosition($('#' + rowNumber)[0]);
oDataTable.fnUpdate([
data.results[0]['0'],
editIcon,
data.results[0]['1'],
data.results[0]['2'],
data.results[0]['3'],
data.results[0]['4'],
data.results[0]['5'],
data.results[0]['6'],
data.results[0]['7'],
data.results[0]['8'],
data.results[0]['9'],
data.results[0]['10'],
data.results[0]['11'],
data.results[0]['12'],
data.results[0]['13'],
data.results[0]['14'],
data.results[0]['15'],
data.results[0]['16'],
data.results[0]['17'],
data.results[0]['18'],
data.results[0]['19']
], pos, 0, false);
//$('#' + tempId).fadeIn('slow');
}
[/code]
All 20 values are crammed into the first cell, separated by comma's. Can anyone see what I'm doing wrong?
[code]
var oDataTable = $('#reporttable').dataTable({
'aaSorting': [[0, 'asc']],
'aLengthMenu': [10, 25, 50, 100],
'iDisplayLength': 10,
'bJQueryUI': true,
'bRetrieve': true,
'sPaginationType': 'full_numbers',
'aoColumnDefs': [{
'bSortable': false,
'aTargets': [1, 20]
}],
'aoColumns': [
{'mData': 0},
{
'mData': null,
'sDefaultContent': printIcon + ' ' + editIcon
},
{'mData': 1}, {'mData': 2}, {'mData': 3}, {'mData': 4}, {'mData': 5},
{'mData': 6}, {'mData': 7}, {'mData': 8}, {'mData': 9}, {'mData': 10},
{'mData': 11}, {'mData': 12}, {'mData': 13}, {'mData': 14}, {'mData': 15},
{'mData': 16}, {'mData': 17}, {'mData': 18}, {'mData': 19}
]
});
[/code]
Here's the "success" portion of the Ajax call:
[code]
success: function(results) {
var data = $.parseJSON(results);
var pos = oDataTable.fnGetPosition($('#' + rowNumber)[0]);
oDataTable.fnUpdate([
data.results[0]['0'],
editIcon,
data.results[0]['1'],
data.results[0]['2'],
data.results[0]['3'],
data.results[0]['4'],
data.results[0]['5'],
data.results[0]['6'],
data.results[0]['7'],
data.results[0]['8'],
data.results[0]['9'],
data.results[0]['10'],
data.results[0]['11'],
data.results[0]['12'],
data.results[0]['13'],
data.results[0]['14'],
data.results[0]['15'],
data.results[0]['16'],
data.results[0]['17'],
data.results[0]['18'],
data.results[0]['19']
], pos, 0, false);
//$('#' + tempId).fadeIn('slow');
}
[/code]
All 20 values are crammed into the first cell, separated by comma's. Can anyone see what I'm doing wrong?
This discussion has been closed.
Replies