How to Move cursor to next Cell after edit value
How to Move cursor to next Cell after edit value
Sunilgoel
Posts: 48Questions: 19Answers: 0
Hi Support,
How to move cursor to next cell after edit value. currently cursor gone after press ENTER.
Regards.
Sunil
This discussion has been closed.
Answers
Hi Sunil,
Is this using KeyTable with inline editing (like this example)? Just to check my understanding, if you edit a cell and press return, you then want the focus to move on to the next cell - is that correct?
Thanks,
Support (aka Allan ).
Hi Allan,
You are right , after Press Enter cursor should move to next cell , currently i am focusing cursor to next cell manually.
Regards.
Sunil
Let me put some code together as an example for how to do this and get back to you.
Regards,
Allan
Here we go:
Basically what it is doing is listening for the
postSubmit
event which is triggered when the Ajax response is returned. It will then determine where the currently focused cell is and on thesubmitComplete
event (which is basically the last thing Editor does after an edit) it will move the focus on to the adjacent cell to the right.You could extend that to move focus to the next line if there is no cell to the right (the
if ( next.length )
).Regards,
Allan
This works only when serverSide option is set to false;
How can I make it work when serverSide option is set to true?
I tried with inline edit option {drawType:'none'}, still the next cell was not selected after submitComplete
KeyTable should support tabbing to the next cell when server-side processing is enabled. Have you tried KeyTable?
Allan
Yes Allan, KeyTable incorporated, tabbing works.
I have also incorporated the above code that listens to postSubmit and SubmitComplete events provided by you.
Followed up further from here https://editor.datatables.net/examples/extensions/keyTable.html seems to be ok now...
Thanks Allan...
Are you able to give me a link to a page that shows the issue? This example shows KeyTable being used with server-side processing, although not with Editor.
Allan
Allan, I have set up the demo link here:
http://datatableslab.openuserapps.com/examples/simple/server-side-processing-keys.html
I have added the following lines of code to the Server-Side example
When I edit inline and hit "Tab" or "Enter" key, focus disappears shortly after data is updated....
Could you try the nightly version of KeyTable please? I believe that should help to resolve the issue.
Allan
Allan, I have updated the same demo link code with the nightly version, i feel the cursor still disappears. Please check once...