Search code examples
javascriptwebix

How to select (focus) row/cell of the webix datatable, so you can move the arrows on the rows/cells?


There is such here a code - webix datatable and button https://snippet.webix.com/bnxnf7x4 When you click on the button, we select the first cell or row (the essence is not important, the cell is set to select: "cell" for the row - select: "row") in the table, but it is not possible to move up/down arrows. At the same time, if you click the mouse in the cell, it is possible to move the arrow keys

The question is how to implement the selection of a table cell/row so that you can scroll (move) through the table cells/rows using the up/down arrows


Solution

  • You need to move focus to the target widget. Only widget which has focus react on navigation keys.

    click: function() {
        $$("myList").select(1, "rank", false);
        webix.UIManager.setFocus($$("myList"));
    }
    

    https://snippet.webix.com/074rxh2z