简体   繁体   English

如何使用Ext JS中的箭头键禁用选项卡导航?

[英]How to disable tabpanel navigation using arrow keys in Ext JS?

When tab is in focus, it is possible to navigate between tabs using arrow keys ( , ). 当标签处于焦点位置时,可以使用箭头键( )在标签之间导航。 I want to disable this behaviour. 我想禁用此行为。

Example tab panel: http://examples.sencha.com/extjs/6.0.2/examples/kitchensink/#basic-tabs 示例标签面板: http : //examples.sencha.com/extjs/6.0.2/examples/kitchensink/#basic-tabs

The config you are looking for is in the Ext.tab.Bar class, and it's called activateOnFocus. 您要查找的配置位于Ext.tab.Bar类中,它称为ActivateOnFocus。

Here's the tab panel example modified to avoi navigation with arrow keys 这是修改为使用箭头键进行avoi导航的选项卡面板示例

Ext.create('Ext.tab.Panel', {
    width: 400,
    height: 400,
    renderTo: document.body,
    tabBar: {
        activateOnFocus: false
    },
    items: [{
        title: 'Foo'
    }, {
        title: 'Bar',
        tabConfig: {
            title: 'Custom Title',
            tooltip: 'A button tooltip'
        }
    }]
});

this worked for me! 这对我有用!

Ext.create('Ext.tab.Panel', {
width: 400,
height: 400,
renderTo: document.body,
tabBar: {
    defaults: {
        flex: 1
    }
},
items: [{
    title: 'Foo'
}, {
    title: 'Bar',
    tabConfig: {
        title: 'Custom Title',
        tooltip: 'A button tooltip'
    }
}]

}); });

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM