0

I want to implement interactive TreePanel with keyboard arrows navigation. After first click on any item it works properly. I added keybinding < A >-add, < E >-edit, < D >-deleting. After Add dialog shown, user enter name of new item and press Ctrl-S or press Save button. Here is code of saving:

saveItem: function(wnd) {
    rec = wnd.getRecord();
    var store = this.getProductCategoryStore();

    if (wnd.parent) {
        parent = wnd.parent
        parent.data.leaf = false;
        parent.set('loaded', false);
    } else
        parent = this.getCategoryTree().getRootNode();

    if (rec.phantom)
        parent.appendChild( rec );
    store.sync();
    wnd.close();

    if (wnd.parent)
        parent.expand();

    this.getCategoryTree().focus();
    this.getCategoryTree().selectPath( rec.getPath() );
},

So, last two rows is my trying to focus on Tree, but it doesn't working. < A >, < E >, < D > - working, but arrows doesn't work. If I clicking on tree manually it works again.

Rustem
  • 2,884
  • 1
  • 17
  • 32

1 Answers1

0

SOLVED. It's cool to use Ext.FocusManager to understand how focus works in application. To proper focusing in tree:

tree.getView().focus()
Rustem
  • 2,884
  • 1
  • 17
  • 32