Prevent reload data from server after submitSuccess
Prevent reload data from server after submitSuccess
There's a way to prevent the whole ajax page reload after successSubmit event? I'm using datatableEditor on a datatable with these options:
processing: true
serverSide: true
I'm using inline excel editor and when I press Enter or Tab button the submit is processed but on success the entire page data is reloaded, losing next cell focus!
Thanks
This discussion has been closed.
Answers
Hi,
If you are using
serverSide
then unfortunately no. When Editor updates the data it will trigger adraw()
call which, when using server-side processing, will always make an Ajax request to get the latest data.KeyTable and Editor should actually play nicely when used with server-side processing. Could you try using the KeyTable nightly and there are also a few changed in Editor which are as yet unreleased related to possible timing errors here. Can I e-mail you at the address your account is registered with, with the latest dev version of Editor which addresses this issue?
Thanks,
Allan
Of course Allan I'll be grateful! Is there a way to stop
draw
event propagation?Thanks
How do you mean - stop it from bubbling up the DOM structure?
Allan
No, I asked if there's a way to stop draw call event propagation after submitSuccess! Is there a way to change the source code to prevent it?
I'm afraid I still don't quite understand (I think its the "event propagation" term that is confusing me in this context - you want to have the
draw
method not be called? Thedraw()
call happens beforesubmitSuccess
, so that event can have no effect on the draw.If I've understood correctly, then there isn't a way to do that in the current release of Editor I'm afraid. However, in the Editor source if you look for:
and replace with:
Then you can use the
drawType
option ofform-options
set to benone
and the redraw will not happen. The downside is that the updated data will not be sorted or filtered correctly (for that a redraw is required).Allan
For anyone who finds this, Allan's solution is included in Editor 1.5.6. It may have been included in earlier versions. To use the
drawType
option:The
none
option was included in 1.5.5+. Full documentation for the form options is available in theform-options
reference.Regards,
Allan