Setting a tabindex for a FlexGrid or FlexSheet

Posted by: stephen on 16 January 2021, 9:19 am EST

  • Posted 16 January 2021, 9:19 am EST

    I like the FlexGid option keyActionTab = CycleOut a lot! It helps to make keyboard navigation between components on the same page more intuitive.

    Cycling (tabbing) OUT of a grid works fine. But how does one get to cycle IN to a grid? The browser expects each component to have a tabindex, but there seems to be no option to set a tabindex for a grid or any of the cells in the grid.

    I have had some success setting a tabindex for the ActiveCell, but the value keeps on reverting back to -1 after cycling out of the grid.

    Do you have advice on how I can set a persistent tabindex value for the grid?

    Thanks!

  • Posted 16 January 2021, 12:08 pm EST

    Answering my own question in case it helps someone else…

    Use the hostElement property to set the tabindex, e.g.:

    flexSheet.hostElement.tabIndex = 401
    

    And that’s it – the focus will cycle in and out of the grid in harmony with other controls (with tabindex set) on the page.

    I got sidetracked by details and missed the obvious :wink:

  • Posted 18 January 2021, 12:23 am EST

    Hi Stephen,

    We are glad that you were able to resolve the issue and thank you for the solution :slight_smile:

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels