There isn't a built in way of doing this at the moment - but what you could do is use initEdit and preSubmit to check the value to be submitted against the value of the field when it was put into edit mode (stored in a variable using the initEdit event). If it is found to be the same call close() and return false from the function.
I have solved the same problem with your proposed solution. Thanks for that.
However I have one more related issue:
I am also using tabbing through the columns as described in the corresponding example.
So basically, every time I tab out of a field, I would like the field to be submitted and the next field should be focused.
This works fine as long as a change takes place.
However, if there is no change, I close and return false on preSubmit, the field just closes and the next one is not opened.
Is there any way to work around this?
Best regards and thanks in advance.
Vedran
P.S.:
If I perform the click event on the next cell twice (in the tabbing logic), the cell is finally opened.
This is however no viable solution.
at the moment, I found a solution of calling "editor.submit()' from within the on() method that processes the tab clicks. seems to work for now, we'll see...
Replies
Hi,
There isn't a built in way of doing this at the moment - but what you could do is use
initEdit
andpreSubmit
to check the value to be submitted against the value of the field when it was put into edit mode (stored in a variable using theinitEdit
event). If it is found to be the same callclose()
and returnfalse
from the function.Allan
thanks, it works!
Dear Allan.
I have solved the same problem with your proposed solution. Thanks for that.
However I have one more related issue:
I am also using tabbing through the columns as described in the corresponding example.
So basically, every time I tab out of a field, I would like the field to be submitted and the next field should be focused.
This works fine as long as a change takes place.
However, if there is no change, I close and return false on preSubmit, the field just closes and the next one is not opened.
Is there any way to work around this?
Best regards and thanks in advance.
Vedran
P.S.:
If I perform the click event on the next cell twice (in the tabbing logic), the cell is finally opened.
This is however no viable solution.
The problem in my last post seems to be solved with the workaround explained by sagimann in this thread
https://datatables.net/forums/discussion/24518/inline-editing-with-tab-between-columns-undoes-values