how to delete datatable rows using onclick button dropdown event ?

how to delete datatable rows using onclick button dropdown event ?

andiabdillahandiabdillah Posts: 1Questions: 0Answers: 0

Greeting,

in another case, I was able to delete the datatable row using a single button <a href="javascript:;" class="btn btn-sm btn-clean btn-icon" title="Delete" id="delete"> <span class="svg-icon svg-icon-md"> <i class="flaticon2-trash text-danger"></i> </span> </a> , with the following event code command $('#tbl_detail').on('click','#delete',function (event) { event.preventDefault(); $('#tbl_detail').DataTable().row($(this).parents('tr')).remove().draw(false); }); , but when using the event dropdown it doesn't work <div class="dropdown dropdown-inline"> <button type="button" class="btn btn-light-primary btn-icon btn-sm" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> <i class="ki ki-bold-more-ver"></i> </button> <div class="dropdown-menu"> <a class="dropdown-item" href="javascript:;"><i class="fas fa-tag"></i> &nbsp; Syarat Pengiriman </a> <a class="dropdown-item" id="delete" href="javascript:;"><i class="fas fa-trash"></i> &nbsp; Delete</a> </div> </div>,

thanks,
Andi Abdillah

Replies

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    We're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.

    Cheers,

    Colin

This discussion has been closed.