A little "b[0].aoData[this[0]] is undefined" workaround
A little "b[0].aoData[this[0]] is undefined" workaround
Hello !
I recently had issues with the selected class method.
$('#table tbody').on('click', 'tr', function () {
myTable.$('tr.selected').removeClass('selected');
$(this).addClass('selected');
}):;
I would then use something like this to get the datas I needed.
$('#btn_delete_data').on('click', function() {
var data = myTable.row( $('tr.selected')).data();
//some code, like "$('#input').val(data[0]);
});
Everything was working perfectly fine until when I started using some json to add datas in my table. (Please note that this is a secondary table in my page, the main table is populated using the correct way do to so).
b[0].aoData[this[0]] is undefined was poping around, but following random paterns, I couldn't find any logic in it.
But I did a little bit of thinking and...
$('#btn_delete_interlocuteur').on('click', function() {
var indexofarray = myTable.row( $('tr.selected') ).index();
var data = myTable.row( indexofarray ).data();
});
This seems to work fine. I have no actual clue of how this is any different, but it works.