angular-datatables icon indicating copy to clipboard operation
angular-datatables copied to clipboard

Access underlying DataTable

Open lianee opened this issue 10 years ago • 5 comments

I'm using the RowReorder plugin of DataTables, which triggers a row-reorder event on the table:

http://datatables.net/extensions/rowreorder/examples/initialisation/events.html

How can I get a reference to the table in order to process this event?

lianee avatar Jan 09 '16 17:01 lianee

as it turns out, the DataTable is destroyed every updates, so event bindings won't work.

lianee avatar Jan 10 '16 23:01 lianee

You can access to the DataTable instance, and thus you can catch the event like this:

dtInstance.DataTable.on('row-reorder', function ( e, diff, edit ) {
    // Do your stuff
});

l-lin avatar Jan 11 '16 08:01 l-lin

That's perfect, thanks

lianee avatar Jan 11 '16 12:01 lianee

@lianee I am using AngularJS 1.5 and I am using angular-datatables but I cannot see plugin for rowReorder. How did you add row reorder?

niteshvirani avatar Mar 15 '24 12:03 niteshvirani

@lianee I am using AngularJS 1.5 and I am using angular-datatables but I cannot see plugin for rowReorder. How did you add row reorder?

Sorry, I'm afraid I can't help because I don't use angular anymore

lianee avatar Mar 15 '24 12:03 lianee