What I mean is... don't use an <a>, just put text in the <th> is that's truely the element you want to handle clicks for.
-----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Ryan Gahl Sent: Monday, January 16, 2006 1:42 PM To: [email protected] Subject: RE: [Rails-spinoffs] Preventing bubble Just don't put a click handler on the <a> -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Gregory Hill Sent: Monday, January 16, 2006 1:18 PM To: [email protected] Subject: RE: [Rails-spinoffs] Preventing bubble Not sure if it'll do what you want, but see my changes below: > var myrules = { > // Disable bubble up to the <tr> that might have an onclick event > '#matrix a' : function(e){ > e.onclick = function(e){ Event.stop(e); return false; > } > } > }; > > Behaviour.register(myrules); > ... > > <th onclick="function(e) { new Ajax.Updater('tableTable', 'http://url?sort=foo' ); Event.stop(e); > return false; }"> > <a href="http://url?sort=foo" onclick="function(e) { new Ajax.Updater('tableTable', > 'http://url?sort=foo'} ); Event.stop(e); return false; }"> > sort by foo > </a> > </th> Mostly, I just changed to Event.stop() from prototype which should kill propagation for you. And you have to return false for browsers like IE. But, since you need to take the event as an argument to pass it to Event.stop, I changed your onclick slightly. I didn't test this at all, but I think it should do what you want. Greg _______________________________________________ Rails-spinoffs mailing list [email protected] http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs The information transmitted in this electronic mail is intended only for the person or entity to which it is addressed and may contain confidential, proprietary, and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from all computers. _______________________________________________ Rails-spinoffs mailing list [email protected] http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs _______________________________________________ Rails-spinoffs mailing list [email protected] http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
