Editor - Tabbing example (Not working)

Editor - Tabbing example (Not working)

simmonszsimmonsz Posts: 7Questions: 2Answers: 0

So I've been looking at the Tab example (https://editor.datatables.net/examples/inline-editing/options.html), and can't seem to get it to work. I've figured out that in the IF statement for checking the keycode, the "else if (cell.next().length)" is returning false (i.e. 0). I think this is the problem, as it's just bypassing it and trying to tab focus the next row, which it isn't doing. It submits and stays focused on the first cell I selected. I'm unsure what I'm doing wrong to cause the length to return as 0. Any ideas?

A link to JS Fiddle with the relevant code: http://jsfiddle.net/9q2xnenm/

Answers

  • allanallan Posts: 63,689Questions: 1Answers: 10,500 Site admin

    Try the code from this example which is slightly updated (in the next release of Editor I'm bring the two examples into line).

    If that doesn't address the issue, can you link me to the page you are working on so I can take a look please?

    Allan

  • simmonszsimmonsz Posts: 7Questions: 2Answers: 0

    If I remove the submitOnBlur code from onClick, and change it to the code used in the example you linked. The tabbing works. However it would be nice to get the submitOnBlur working.

    Also using that example it isn't possible to change something in a select list, as when you hit return/enter to save the new change, it just opens up the select list (just FYI, or maybe I'm doing something wrong there too)

    Thanks for the quick response and keep up the good work! :)

  • allanallan Posts: 63,689Questions: 1Answers: 10,500 Site admin

    Can you try the code from my other example + submitOnBlur? What happens then?

    Also using that example it isn't possible to change something in a select list, as when you hit return/enter to save the new change, it just opens up the select list (just FYI, or maybe I'm doing something wrong there too)

    Good point - you would need a button to submit the form, or use submitOnBlur.

    Allan

  • simmonszsimmonsz Posts: 7Questions: 2Answers: 0

    Apologies for the late reply.

    That is one of the first things I tried. The result is that the tabbing across columns stops working, while the submitOnBlur works.

    I tried a quick little test and it's getting to the code, which is suppose to tab across to the next column...but obviously doesn't as started above. It will then submit the data in the first cell I selected, as if I didn't even implement the code to tab across.

    Cool :)

  • simmonszsimmonsz Posts: 7Questions: 2Answers: 0
    edited January 2015

    Not sure if this will help, but I also did the DataTables debugger. The code is "imiced"

  • allanallan Posts: 63,689Questions: 1Answers: 10,500 Site admin

    I'm afraid I would need to be able to view the page. The debugger doesn't give the information that would be required to understand what is going wrong in this case.

    Allan

  • simmonszsimmonsz Posts: 7Questions: 2Answers: 0

    Hi Allan. I've sent you a PM with the link to the website. If we find a solution, I'll post the answer here for future references.

This discussion has been closed.