Cannot call method 'fnSetData' of undefined while fnUpdate
Cannot call method 'fnSetData' of undefined while fnUpdate
indapublic
Posts: 2Questions: 0Answers: 0
Hello, everyone!
I have this code:
[code]
$.post('myurl', params, function(response) {
if (response.result == 'success') {
if (params.id == undefined) {
$('#table-customers').dataTable().fnAddTr($(response.row_html)[0]);
} else {
$('#table-customers').dataTable().fnUpdate($(response.row_html)[0], 0); // 0, for example. Table have two rows currently
}
}
});
[/code]
If I execute fnAddTr - all fine. If I execute fnUpdate - I receive message "Uncaught TypeError: Cannot call method 'fnSetData' of undefined" in console. What am I doing wrong?
I have this code:
[code]
$.post('myurl', params, function(response) {
if (response.result == 'success') {
if (params.id == undefined) {
$('#table-customers').dataTable().fnAddTr($(response.row_html)[0]);
} else {
$('#table-customers').dataTable().fnUpdate($(response.row_html)[0], 0); // 0, for example. Table have two rows currently
}
}
});
[/code]
If I execute fnAddTr - all fine. If I execute fnUpdate - I receive message "Uncaught TypeError: Cannot call method 'fnSetData' of undefined" in console. What am I doing wrong?
This discussion has been closed.