PDA

View Full Version : enableKeyEvents, specialkey NOT WORKING



hermann.s
8 Nov 2013, 6:29 AM
It just seems to not be working, does anyone have a clue what could be wrong?


Ext.define('MCS.controller.search.Result', {
extend: 'Ext.app.Controller',
stores: ['Search'],
views: ['search.Result', 'search.Toolbar'],

init: function () {
this.control({
'searchToolbar#searchString':
{
specialkey: this.performSearch
}
});
},

performSearch: function () {
if (Ext.EventObject.getKey() == Ext.EventObject.ENTER) {
console.log("Searched Performed");
}
}
});



Toolbar is docked to Results Gridpanel...

Ext.define('MCS.view.search.Toolbar', {
extend: 'Ext.toolbar.Toolbar',
alias: 'widget.searchToolbar',

itemId: 'searchToolbar',

items:
[
{ xtype: 'textfield', itemId: 'searchString', emptyText: 'Search String', width: 180, enableKeyEvents: true },
{ xtype: 'button', text: 'Search' }
],

initComponent: function () {

this.callParent();
}
});

hermann.s
8 Nov 2013, 8:05 AM
Nevermind.
My query was wrong.

Should be
'searchToolbar > textfield#searchString'