var anSelected = fnGetSelected( oTable ) not executing
var anSelected = fnGetSelected( oTable ) not executing
var oTable = $('#posGridView').dataTable( {
"bPaginate": false,
"bFilter": false,
"bSort": false,
"bInfo": false,
"oLanguage": {
"sZeroRecords": "",
"sEmptyTable": ""
}
} );
$("#posGridView tbody").click(function(event) {
$(oTable.fnSettings().aoData).each(function (){
$(this.nTr).removeClass('row_selected');
});
$(event.target.parentNode).addClass('row_selected');
});
The above code working fine, when I select row , it highlight. But when I Press Delete Button , selected row not deleting.
$('#delete').click( function() {
var anSelected = fnGetSelected( oTable );
oTable.fnDeleteRow( anSelected[0] );
} );
When I put an alert(anSelected), I come to know that the statement var anSelected = fnGetSelected( oTable ); not executing.
"bPaginate": false,
"bFilter": false,
"bSort": false,
"bInfo": false,
"oLanguage": {
"sZeroRecords": "",
"sEmptyTable": ""
}
} );
$("#posGridView tbody").click(function(event) {
$(oTable.fnSettings().aoData).each(function (){
$(this.nTr).removeClass('row_selected');
});
$(event.target.parentNode).addClass('row_selected');
});
The above code working fine, when I select row , it highlight. But when I Press Delete Button , selected row not deleting.
$('#delete').click( function() {
var anSelected = fnGetSelected( oTable );
oTable.fnDeleteRow( anSelected[0] );
} );
When I put an alert(anSelected), I come to know that the statement var anSelected = fnGetSelected( oTable ); not executing.
This discussion has been closed.
Replies
Allan