Use Keys extension to move to next editable cell

Use Keys extension to move to next editable cell

nsscottnsscott Posts: 24Questions: 10Answers: 0

I am using the latest version of datatables with the Keys extension with an inline editor.

My table rows contains a mix of editable and non-editable cells. We want clicking the arrow and tab keys to skip over the non-editable to the next editable cell. Below illustrates what we want but we are at loss to make it happen.

Answers

  • colincolin Posts: 15,237Questions: 1Answers: 2,598

    Hi @nsscott ,

    You can use a selector to specify those columns not to allow inline editing with, like this.

    Cheers,

    Colin

  • nsscottnsscott Posts: 24Questions: 10Answers: 0

    Thanks for the reply Colin.

    I should have called out that the columns which support input change on a row by row basis. The example is useful if the same columns support input across all rows.

    Any thoughts on how to deal with that?

  • colincolin Posts: 15,237Questions: 1Answers: 2,598

    That won't be possible, I'm afraid, since it's purely on a column basis.

    C

  • nsscottnsscott Posts: 24Questions: 10Answers: 0

    There are no other options?

    I tried capturing the the key-focus event to determine what key the user had pressed via the OrignalEvent parameter and use the keys.move method to navigate appropriately but did not manage to get this to work.

    Could I set the column selector you mention above but reset the columns appropriately when the user moves to another row?

  • allanallan Posts: 63,180Questions: 1Answers: 10,411 Site admin

    I think the only option would be to use key-focus as you mentioned and use that to run whatever custom logic you have for determining if the focus should be moved on or not.

    Perhaps you can show me the code you used and didn't work? Also, were you using the nightly version of KeyTable. I think I might have deployed the keys.move() method document a bit early - you need the latest version for it.

    Allan

This discussion has been closed.