当选项卡处于焦点时,可以使用箭头键(→,←)在选项卡之间导航。我想禁用此行为。
示例选项卡面板:http://examples.sencha.com/extjs/6.0.2/examples/kitchensink/#basic-tabs
您正在寻找的配置位于Ext.tab.Bar类中,它名为activateOnFocus。
这是修改后的选项卡面板示例,以避免使用箭头键进行导航
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'
}
}]
});
这对我有用!
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'
}
}]
});