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 8340041
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T05:03:44+00:00 2026-06-09T05:03:44+00:00

I am trying to capture a .keypress event from JQuery in some Sencha elements,

  • 0

I am trying to capture a .keypress event from JQuery in some Sencha elements, but it seems that somehow Sencha is hiding them to JQuery.

I’ll show a piece of code, that is simplier, but has the same problem:

        Ext.onReady(function(){

            $("#jquery").click(function() {
                alert('Handler for click called.');
            });

            var contextMenu = new Ext.menu.Menu({
                renderTo: document.body,
                width: 150,
                floating: false,
                plain: true,
                items: [{
                    text: 'button1',
                    id: 'jquery'
                },{
                    text: 'button2'
                }]
            });
        });
    </script>
</head>
<body>
<div id="test"> I am a div </div>
</body>

My objective here is that when I click on button1 the alert’s pop up is shown, but it doesn’t happen. However, if I change the JQuery code to:

$("#test").click(function() {
alert('Handler for click called.');
});

And I click over the div content the pop up it is shown, so the library is correctly loaded.

I think it must be something related to how Sencha creates the html, which I have inspect, and I can see that button1 is like follows:

<a id="jquery" class="x-menu-item" hidefocus="true" unselectable="on" href="#"><img alt="" src="data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" class="x-menu-item-icon " id="ext-gen7"><span class="x-menu-item-text" id="ext-gen8">button1</span></a>

But still I cannot use JQuery where I want.
Any idea or solution to access sencha elements with JQuery selector?

  • 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-09T05:03:47+00:00Added an answer on June 9, 2026 at 5:03 am

    i dont know why do you wanna use ExtJS with jquery
    try avoiding using both because that will only increase the page times and wont add any new functionality
    Extjs in itself is a pretty big library and surely supports DOM manipulation

    Problem with your code is that Ext.onReady() event fires when all the dependencies have been loaded. ExtJS makes the HTML elements dynamically so at the time when this event is raised all the scrips are present but nothing has been created so there is no element with the id jquery hence you cannot access it via jquery

    what i would suggest insted of this is to
    *put this peice of jquery code inside some afterrender event so that you are sure that the HTML element is present
    *if you cant do this then use jquery live OR jquery on because they are function that can be used to assign event handlers to dynamically created elements.
    *most prefrred would be to put a listener in the ExtJS style to the element and Extjs will handle the raising of the event for you. Something like this

    listeners: {
            click: {
                element: 'el', //bind to the underlying el property on the panel
                fn: function(){ console.log('click el'); }
            },
            dblclick: {
                element: 'body', //bind to the underlying body property on the panel
                fn: function(){ console.log('dblclick body'); }
            }
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to capture sub-strings from a string that looks similar to 'some
I've been trying to capture MotionEvents that are from the stylus and I want
I am trying to capture a session ID from a URL so that the
I am trying to capture output from an install script (that uses scp) and
I'm trying to capture key-value pairs from strings that have the following form: a0=d235
I am trying to capture / extract numeric values from some strings. Here is
I'm trying to capture key down events from the MainWindow, but I have a
I'm trying to capture http request that occurs in a callback function : //
I'm trying to capture the ENTER event of a TextInput like so: a_txt.addEventListener(fl.events.ComponentEvent.ENTER, aEnter);
I am trying to capture urls in an html page that is being repeated

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.