1. #1
    Ext User
    Join Date
    Mar 2007
    Posts
    47
    Vote Rating
    0
    cwells is on a distinguished road

      0  

    Default Unanswered: Real basic: how to cancel click event

    Unanswered: Real basic: how to cancel click event


    Should be simple. Isn't. The a tag has an href, so the browser wants to follow the link. I don't want it to. Instead I want to load the href via an AJAX call.

    Code:
    Ext.onReady ( function () {
        Ext.BLANK_IMAGE_URL = "/js/extjs/resources/images/default/s.gif";
    
        Ext.select ("div#topmenu ul li a").on ("click", (
             function (e, t) {
                 e.cancelEvent();   // doesn't work
                 return false;        // doesn't work either 
             }
         ));
    });
    I'm hoping to eventually replace this bit of jQuery code with an Ext equivalent:

    Code:
    $(function() {
        $("div#topmenu ul li a").click ( function() {
            $("div#middle").fadeOut ("slow").hide().load (
                $(this).attr("href"),
                function() { $("div#middle").fadeIn("slow"); }
            );
            $("a.active").removeClass ("active");
            $(this).addClass("active");
            return false;
        });
    });
    but I can't even get past handling the click properly, which is frankly pretty discouraging.

  2. #2
    Ext User
    Join Date
    Mar 2007
    Posts
    47
    Vote Rating
    0
    cwells is on a distinguished road

      0  

    Default


    Crap. Of course I screwed it.

    e.stopEvent() not e.cancelEvent().

Similar Threads

  1. cancel of onblur event when cancel the form
    By sreevani in forum Ext 2.x: Help & Discussion
    Replies: 3
    Last Post: 17 Feb 2009, 5:17 AM
  2. how cancel event in grid
    By gersonczjr in forum Ext 2.x: Help & Discussion
    Replies: 2
    Last Post: 20 Jan 2009, 8:56 AM
  3. How to handle 'real' TreePanel beforeload event?
    By abent in forum Ext 2.x: Help & Discussion
    Replies: 0
    Last Post: 30 Oct 2007, 5:21 AM
  4. basic dialog with save and cancel buttons
    By Teena in forum Ext 1.x: Help & Discussion
    Replies: 0
    Last Post: 17 Sep 2007, 10:44 AM
  5. How can I cancel an event?
    By dee_rocks in forum Ext 1.x: Help & Discussion
    Replies: 1
    Last Post: 10 Sep 2007, 2:54 PM

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar