Delete button on each row

Delete button on each row

MartinMartin Posts: 3Questions: 0Answers: 0
edited May 2011 in General
In this previous post (http://datatables.net/forums/comments.php?DiscussionID=4463#Comment_18291) Allan mentions that "I think in this case it might be better just to have a delete button on each row". I was trying to do this myself in my project, but I was having trouble with creating such a row using fnAddData; it seemed like fnAddData was not suited to creating rows where one column contained buttons rather than data. Does anyone know where I can find an example of this type of table? This (http://www.datatables.net/examples/api/select_single_row.html) is a good example of how a "Delete selected row" button would work, but I can't find any examples of a column of "Delete row" buttons. If anyone could point me towards such an example it would be very much appreciated.

Replies

  • uriyuriy Posts: 3Questions: 0Answers: 0
    You can insert html into ceils like this:
    [code]
    $('#example').dataTable().fnAddData( [
    sip.sip_number,
    sip.ipaddr,
    sip.sip_password,
    ""] );
    [/code]
    This code add 4 colums to row, in last column insert image with onclick function.
  • MartinMartin Posts: 3Questions: 0Answers: 0
    Thank you very much. That worked great! :)
This discussion has been closed.