conditional delete

conditional delete

vinod_ccvvinod_ccv Posts: 75Questions: 0Answers: 0
edited February 2013 in Editor
$_POST['action']=='delete' i want to make a check so that if the $_POST['id'] item is used in another subcategory table. If so i have to stop execution and show the message. Where to incorporate this test in php side?

Replies

  • allanallan Posts: 61,650Questions: 1Answers: 10,094 Site admin
    Just before you call the `process` method on the Editor instance I'd say. Or anywhere before you initialise the Editor instance would do as well.

    Allan
  • vinod_ccvvinod_ccv Posts: 75Questions: 0Answers: 0
    Thank you Allan,
    But how to get the custom error message to client?
  • allanallan Posts: 61,650Questions: 1Answers: 10,094 Site admin
    Respond with an `error` parameter set: http://editor.datatables.net/server/#error
  • vinod_ccvvinod_ccv Posts: 75Questions: 0Answers: 0
    i would like to customize this Global form error and appear on top of data table window
  • allanallan Posts: 61,650Questions: 1Answers: 10,094 Site admin
    edited February 2013
    Well the `error` is the global error so you could use that - but it shows at the bottom of the modal. To show it at the top you would need to create a custom display controller.

    Allan
This discussion has been closed.