Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 82273

Strange OnReturn behaviour

$
0
0

Hi
Not sure if I've missed something here but I have come across an anomoly which has left me a bit stumped.
I have been using DataTables for a long time now and it is indeed a fantastic framework, thank you! I've recently started to add some limited Editor functions.
See here for test case: http://rapid.prismbrainmapping.com/draft/datatables

If I click 'Edit' on a record, I get the 'edit' form. If I click the 'Save' button, I get the custom action that is set on the .edit API call. Also, if I click 'Delete' on a record, I get the 'remove' form. If I then click on the 'Delete' button, the record disappears from my table and I get the custom action that is set on the .remove API call. No actual editing or deleting takes place but I have ensured that my MVC controller is passing back the correct data in JSON format. All good so far!

Now, if I open the 'Edit' form again, make a change on the form, and just hit the Return button, the form disappears (after the edit) but no custom function is run, as expected from you documentation about the onReturn formoption - https://editor.datatables.net/reference/type/form-options#onReturn---Action-to-take-on-return-key-when-the-form-is-focused
Again, all good so far.

However, if I open the 'Delete' form again, and just hit the Return button, the following odd things happen:
If using Chrome
1 - I DO (unexpectedly) get the custom action that is set on the .remove API call
2 - I cannot close the 'Delete' form modal - nothing works, not the Escape button, not the Close button or clicking outside the modal.

If using IE
1 - I DO NOT get the custom action that is set on the .remove API call (as expected)
2 - I can close the 'Delete' form modal but nothing has been deleted.

Any ideas??
Many thanks


Viewing all articles
Browse latest Browse all 82273

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>