はsencha fiddleの内側に以下のコードを追加します。
Ext.application({
name : 'Fiddle',
launch : function() {
Ext.create({
xtype: 'panel',
fullscreen: true,
bodyPadding: true, // don't want content to crunch against the borders
title: 'Focusable Elements',
items: [{
xtype: 'textfield',
label: 'field A',
tabIndex: 2,
listeners: {
blur: function (field) {
console.log('field A loses focus!')
}
}
}, {
xtype: 'textfield',
label: 'field B',
tabIndex: 1,
listeners: {
blur: function (field) {
console.log('field B loses focus!')
}
}
}, {
xtype: 'panel',
title: 'Panel 1',
height: 200,
html: 'Focus on Me!',
tabIndex: 4,
focusable: true,
layout: {
type: 'vbox',
align: 'stretch',
pack: 'start'
},
listeners: {
blur: function (panel) {
console.log('Panel 1 Lost Focus!');
},
focus: function (panel) {
console.log('Panel 1 Got Focus!');
}
}
}, {
xtype: 'panel',
title: 'Panel 2',
height: 200,
html: 'Focus on Me!',
tabIndex: 5,
focusable: true,
layout: {
type: 'vbox',
align: 'stretch',
pack: 'start'
},
listeners: {
blur: function (panel) {
console.log('Panel 2 Lost Focus!');
},
focus: function (panel) {
console.log('Panel 2 Got Focus!');
}
}
},{
xtype: 'textfield',
label: 'field D',
tabIndex: 3,
listeners: {
blur: function (field) {
console.log('field D loses focus!')
}
}
}],
});
}
});
フィールドBに焦点を当てて、タブボタンを押してスタート。..
あなたがここに達成するために何をしようとしていますか?あなたはフィドルがありますか? [blur](http://docs.sencha.com/extjs/6.5.2/modern/Ext.Container.html#event-blur)は、コンポーネントがフォーカスを失ったときに発生するイベントです。 –
私はテキストフィールドa、テキストフィールドb、私のコンポーネント、テキストフィールドc。 aをクリックしてTabを一度押すと、textifeld bに移動する必要があります。Tabキーをもう一度押すと、コンポーネントに移動する(または非表示にする)必要があります。私はコンポーネントをフォーカス可能にすることができません。申し訳ありませんフィドル、私は、私はセンチャフィデルアカウントを作成する必要があります。 –
コンポーネントのタイプは?例えば「パネル」? –