Editor inline tabbing issue
Editor inline tabbing issue
I am trying to create an inline editor instance on a table where the user can use the 'tab' key to move between editable fields. I have followed the example here, which is what I'm trying to implement: https://datatables.net/examples/editor/inline-editing/tabControl.html
and created a test case here: https://admin.prismbrainmapping.com/test/datatables
The user clicks into the first (or indeed any) cell and the editor instance shows correctly as an editable input field. The user edits the field and clicks the tab key to move to the next editable field. The focus appears to move correctly to the next field but the editor instance remains on the original field and does NOT open on the new field.
No error messages are shown and nothing appears in the JS console.
My Editor instance 'formOptions' object:
formOptions: {
inline: {
onBlur: 'submit'
}
}
My DataTable instance 'key' object:
keys: {
columns: ':not(:last-child)',
keys: [9],
editor: ed,
editOnFocus: true
}
DataTable onclick listener:
dt.on('click', 'tbody td:not(:last-child)', function (e) {
ed.inline(this);
});
What have I missed, please?
Thanks in advance.
Answers
Hi Andy,
Are you able to PM me login details for your example page so I can take a look and see what is going on?
That said, from the code you have above, you are using both KeyTable and a custom event listener to trigger the
inline()method which might be the issue. Just let KeyTable do it, like in the example you linked to. It will activate inline editing on cell focus, through theeditOnFocusoption, and it has a listener for clicks on cells to activate focus.Allan
Ah sorry Allan, that page should allow anonymous users - clearly not!!
Anyway, thanks for the insight. I thought it would always need the event listener to trigger the inline edit but also the keys object to customise it's usage.
I'll give it a quick try and let you know.
Cheers
Andy
Hmm strange, now I don't get any editor at all. I'll try to open the page up for you but it will have to wait as I have to catch a train now!!
No worries. Drop me a PM or message again here when its available.
Hope the train isn't too crowded!
Allan