["Select" extension] Event triggered when selected row is removed from table ?

["Select" extension] Event triggered when selected row is removed from table ?

RupertBarrowRupertBarrow Posts: 23Questions: 3Answers: 0

What event should I look out for to detect when the selected rows in a table have all been deleted ?
"deselect" does not trigger in that situation.

Answers

  • allanallan Posts: 62,099Questions: 1Answers: 10,183 Site admin

    Editor will trigger postRemove when a row is deleted. DataTables itself does not trigger an event when row().remove() is triggered. If you aren't using Editor, you'd need to trigger an event or a callback where to perform the delete.

    Allan

  • RupertBarrowRupertBarrow Posts: 23Questions: 3Answers: 0

    Thanks Allan.
    I'm not using Editor.
    How would I go about hooking in to Datatables.net to trigger an event after row().remove() ? If you can point me to the right doc, I'll try to pick it up from there.

  • allanallan Posts: 62,099Questions: 1Answers: 10,183 Site admin

    You wouldn't - you would just use $().trigger() directly - e.g.:

    table.row(0).remove();
    $(table.table().node()).trigger('row-delete');
    

    Or something like that.

    Allan

  • RupertBarrowRupertBarrow Posts: 23Questions: 3Answers: 0

    Thanks, I didn't know about "trigger".
    I'll have a look.

Sign In or Register to comment.