Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7982125
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T10:35:05+00:00 2026-06-04T10:35:05+00:00

What I have tried: new Ext.util.KeyMap({ target: ‘search’, eventName: ‘itemkeydown’, binding: [ { key:

  • 0

What I have tried:

    new Ext.util.KeyMap({
        target: 'search',
        eventName: 'itemkeydown',
        binding: [
            {
                key: Ext.EventObject.ESC,
                scope: this,
                fn: function() {
                    console.log('esc');
                },
                defaultEventAction: 'preventDefault'
            }
        ]
    });

where search is the id of the element. Though it doesn’t bind to the element – I pass focus to it, press ESCAPE and callback isn’t fired.

What have I missed?

PS: I also tried Ext.get('search') instead of search with the same results.

PPS: search element is not an ExtJS control, it is regular <input type="text" ...>

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T10:35:06+00:00Added an answer on June 4, 2026 at 10:35 am

    Here is my working code:

    var map = new Ext.util.KeyMap({
        target: 'search',
        eventName: 'keydown', // changed from itemkeydown -> keydown
        binding: [{
                key: Ext.EventObject.ESC,
                scope: this,
                fn: function() {
                    console.log('esc');
                },
                defaultEventAction: 'preventDefault'
            }
        ]
    });
    

    My HTML element is as follows:

    <input type="text" id="search"/>
    

    keydown seems to be the default value for eventName. The code will work without it. You could also get it working by using the 4.0 style:

    var map = new Ext.util.KeyMap("search", {
        key: Ext.EventObject.ESC,
        handler: function() {
            console.log('esc');
        },
        scope: this,
        defaultEventAction: 'preventDefault'
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Ok I am new to app development I have tried dozen of codes and
I'm new in soapclient, I have tried to do some study online and also
I am new to Android. I have tried an sample application for status bar
i've installed new sdk 3.2 pre-release wich have iPad simulator, i have tried to
Complete new person to Ruby and Rails here... Have tried some tutorials in the
So I am pretty new to JSP. I have tried this a few ways.
i have class named Group i tried to test configuration: var cfg = new
I have a Ext.form.DateField: new Ext.form.DateField({ id: 'date_from', format: 'd/m/Y', editable: false, listeners: {
I have a store: var store = new Ext.data.store({ autoLoad: true, autoSync: true, model:
I have a nested list in my application : this.nestedList = new Ext.NestedList({ store:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.