Hybrid View
-
20 Aug 2010 11:45 AM #1
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.
I'm hoping to eventually replace this bit of jQuery code with an Ext equivalent: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 } )); });
but I can't even get past handling the click properly, which is frankly pretty discouraging.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; }); });
-
20 Aug 2010 11:54 AM #2
Crap. Of course I screwed it.
e.stopEvent() not e.cancelEvent().
Similar Threads
-
cancel of onblur event when cancel the form
By sreevani in forum Ext 2.x: Help & DiscussionReplies: 3Last Post: 17 Feb 2009, 5:17 AM -
how cancel event in grid
By gersonczjr in forum Ext 2.x: Help & DiscussionReplies: 2Last Post: 20 Jan 2009, 8:56 AM -
How to handle 'real' TreePanel beforeload event?
By abent in forum Ext 2.x: Help & DiscussionReplies: 0Last Post: 30 Oct 2007, 5:21 AM -
basic dialog with save and cancel buttons
By Teena in forum Ext 1.x: Help & DiscussionReplies: 0Last Post: 17 Sep 2007, 10:44 AM -
How can I cancel an event?
By dee_rocks in forum Ext 1.x: Help & DiscussionReplies: 1Last Post: 10 Sep 2007, 2:54 PM


Reply With Quote