Editor: inline > onBlur seems always be activated
Editor: inline > onBlur seems always be activated
Hi all,
I'm using the datatables editor and have implemented the inline editing function.
Everything is working as expected, except one use case:
* User clicks on field
* User adds data
* User does NOT press ENTER, but clicks another field or outside the table
* Field gets closed.
Expected behavior:
* No data is changed / No data is send to the server
Current behavior
* Data is send to server
* Data is changed
* If the data was invalid:
* Error message is shown under the next field the user opens and not under field, where the data was changed.
There is an example how to activate this behavior: https://editor.datatables.net/examples/inline-editing/options.html
But in my case, I have not activate it and I see no way to deactivate it.
My inline activation code is
$('#entries-table').on( 'click', 'tbody td:not(:first-child)', function (e) {
editor.inline( this, {
} );
} );
Any ideas, what I have misconfigured?
Daniel
Replies
Hi Daniel,
Are you using a one-to-many join or a complex input field type such as selectize or some other plug-in? Can you show me your Editor initialisation code please?
Thanks,
ALlan
Hi Allan,
no one-to-many join, but maybe a complex input field (datetime).
My editor initialisation code:
I have also registered a couple of events:
To make the code complete, here is my datatable initialisation:
I do not see any black voodoo inside my code...
Hint: The {{ }} inside the ajax-urls are coming from jinja and are replaced by strings during server-side HTML generation.
Daniel
Hi Daniel,
Thanks for the extra information! The
datetime
field type is really just a string value, so it wouldn't be that causing the issue.I'm afraid I don't see anything wrong with your configuration above! Are you able to send me a link to the page so I can debug it? You can PM me by clicking my name above and then the "Send message" button.
Thanks,
Allan