Inline Editor Remove focus class on Change or onBlur Click on an other Field
Inline Editor Remove focus class on Change or onBlur Click on an other Field
I am using the Inline editor with keys: to update a couple fileds in a table.
Everything works as expected what I am hoping to find is a way to remove the focus after update or if I click a different field in the table onBlur. After update or clcking a different filed if I hit the esc key it clears the focus class on the previously selected field.
I have tried many different variations but with no luck, the submit works and it also refreshes an iFrame on chnge.
I am pretty new so lot's of trial and error but no joy.
editor.field('quantity').input().on('change', function(e, data) {
if (!data || !data.editor) {
editor.submit();
editor.field('quantity').classList.remove("focus");
window.parent.document.getElementById('TransactionTotal').contentDocument.location.reload(true);
}
});
Any thoughts or input would be greatly apreciatted.
Harold
Answers
I had enabled KeyTable for navigation. I believe that is what was maintaining focus even if you navigated away from the Field.
Adding the below line apears to remove focus on change
Noticing the relationship to KeyTable, I removed the keys: function and enabled inline editing and everything works as I had hoped.
Take Care
Harold
Yes - you typically wouldn't want to call
inline()
yourself as well as having KeyTable do it. They will conflict. Instead just let KeyTable do it.Allan