DataTables Table Tools - Deleting a row after inserting it
DataTables Table Tools - Deleting a row after inserting it
Basically, im trying to combine this:
http://datatables.net/release-datatables/examples/api/select_single_row.html
With this:
http://datatables.net/release-datatables/examples/api/add_row.html
The JS and CSS link directly to the DataTables site, just for testing.
http://pastebin.com/2DQX68H0
basically, it allows me to delete the existing rows, but the ones I insert, wont get deleted. Im guessing its because it gets a list of tables when the document loads, and thats what it uses to reference when it deletes rows. Im somewhat new to jQuery and DataTables, so any help would be appreciated.
Thanks in advance!
http://datatables.net/release-datatables/examples/api/select_single_row.html
With this:
http://datatables.net/release-datatables/examples/api/add_row.html
The JS and CSS link directly to the DataTables site, just for testing.
http://pastebin.com/2DQX68H0
basically, it allows me to delete the existing rows, but the ones I insert, wont get deleted. Im guessing its because it gets a list of tables when the document loads, and thats what it uses to reference when it deletes rows. Im somewhat new to jQuery and DataTables, so any help would be appreciated.
Thanks in advance!
This discussion has been closed.
Replies
Change that for:
[code]
$("#example tbody").on('click', 'tr', function( e ) {
[/code]
and that should do it. See http://datatables.net/faqs#events for more information about it.
Regards,
Allan
What about having this delete multiple rows? I got it to select it, but im guessing this part..
[code]if ( anSelected.length !== 0 ) {
oTable.fnDeleteRow( anSelected[0] );
}[/code]
needs a loop in it.
Allan