Call editor open on callback
Call editor open on callback
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
This discussion has been closed.
Answers
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
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.
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 defaultfnClick
function for theeditor_edit
button with your own function. Possibly the easiest way is to copy thefnClick
from the source file and modify to suit your needs.Allan
Thanks