keymapping

Ext JS 4: Bind Keys to a Form

Here is one way to bind a key to a form/component/element in Ext JS 4. The link below also shows examples of key bindings when using MVC.

Ext.define('My.App.QuickFindContainer', {
	extend: 'Ext.container.Container',
	alias: 'widget.quickfindcontainer',
	//all the needed configs, items and initComponent

	afterRender: function () {
		this.callParent(arguments);
		this.nav = Ext.create('Ext.util.KeyNav', this.el, {
			enter : this.doFind,
			scope: this
		});
	}
});

Helpful links: http://www.sencha.com/forum/showthread.php?131596-Form-submit-on-Enter

Version Info:
Ext JS 4.1.1

Advertisements