server side processing delete one row

server side processing delete one row

cmoozcmooz Posts: 21Questions: 0Answers: 0
edited April 2009 in General
hi,

i want to add a link to each row of my table to delete this row, this row should also be removed from my database using ajax, best would be to have an alert with y/n question. Is that possible?

Replies

  • allanallan Posts: 61,450Questions: 1Answers: 10,055 Site admin
    This is dealt with to some degree in your other thread about server-side processing features. What needs to be done here is have an XHR send a 'delete' row request to the server. Then call fnDraw() to redraw the table taking account of the deleted row. Confirmation of the delete action can be achieved using the Javascript standard confirm() function.

    Allan
  • cmoozcmooz Posts: 21Questions: 0Answers: 0
    uff what is XHR and how can i call a function to delete the sql data
  • allanallan Posts: 61,450Questions: 1Answers: 10,055 Site admin
    XHR == XMLHttpRequest ( http://en.wikipedia.org/wiki/XMLHttpRequest ) - what Javascript uses for async communication with the server. jQuery provides easy methods for sending XHR requests to the server: http://docs.jquery.com/Ajax .

    Then you need a server-side script which will deal with the data that you pass it to delete the row in the database.

    Allan
This discussion has been closed.