Call editor open on callback

Call editor open on callback

russlevyrusslevy Posts: 15Questions: 6Answers: 0

Hi,

I'm using datatables editor with tabletools which generates create edit and delete.

When edit is clicked I'm using on('open') to make change to the form which includes an ajax call.

Is there a way for me to delay the open of of the form until the ajax call has completed?

Thanks!

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,534Questions: 1Answers: 10,475 Site admin

    Hi,

    To do this you would need to trigger the inline() method inside your Ajax success callback. Editor will automatically show the inline editing as soon as that method is called.

    Allan

  • russlevyrusslevy Posts: 15Questions: 6Answers: 0

    HI Allan,

    Thanks! Since I'm using tabletools the edit button is automatically generated and it automatically opens the pop up form. I use on open to start the ajax call but I'm wondering if there is a way to delay the open of the form until I finish the ajax call.

  • allanallan Posts: 63,534Questions: 1Answers: 10,475 Site admin
    Answer ✓

    Sorry - I'm not sure why I thought you were using inline editing.

    For the buttons, the issue is basically the same - you need to trigger the edit() method at the point when you want to have the Editor window displayed. You would need to replace the default fnClick function for the editor_edit button with your own function. Possibly the easiest way is to copy the fnClick from the source file and modify to suit your needs.

    Allan

  • russlevyrusslevy Posts: 15Questions: 6Answers: 0

    Thanks

This discussion has been closed.