PDA

View Full Version : TabPanel Navigation by Keys



riya_phoenix
30 Dec 2009, 1:39 PM
Hi,
I am trying to add key board navigation to the tab panels using keys (http://www.extjs.com/forum/../deploy/dev/docs/source/Panel.html#cfg-Ext.Panel-keys) property. Below is the example code. Short cut key doesn't work when the tab1 is rendered for the first time. But it works after the tabs have been selected once. Am i missing something basic. Can some one please help me?




Ext.onReady(function(){
// basic tabs 1, built from existing content
var tabs = new Ext.TabPanel({
renderTo: 'tabs1',
width:450,
activeTab: 0,
frame:true,
defaults:{autoHeight: true},
keys:new Ext.KeyMap("tabs1", {
key:"a",
fn: function(){ alert("a is pressed"); }
}),
items:[
{contentEl:'script', title: 'Short Text'},
{contentEl:'markup', title: 'Long Text'}
]
});
}
-Riya