Hybrid View
-
23 Jan 2013 2:45 AM #1
hyperlink event for display a popup
hyperlink event for display a popup
Hi everybody,
i would to know if it's possible to display a popup when we click on the hyperlink in the html code.
I use Sencha Architect with Touch 2.1.
Thanks a lot.
-
23 Jan 2013 11:40 AM #2
Sure, put an anchor tag in your html.
On the top level element of the container that it is in you could do something like...
stopEvent will stop the event from propagating and prevent the default action (follow the anchor link).Code:this.el.on('click', function(e, t) { e.stopEvent(); // show the popup });Aaron Conran
@aconran
Sencha Architect Development Team
-
23 Jan 2013 11:42 AM #3
Ah noticed you are using Touch, sorry you would want to switch this to tap.
GeoCongress is a good example that shows a confirmation box telling you when you tap on a link that opens in another window.
https://github.com/SenchaArchitect/GeoCongressAaron Conran
@aconran
Sencha Architect Development Team
-
24 Jan 2013 2:14 AM #4
thank you very much.
Sorry but can you be more specific please.
i have a hyperlink in my html code like that :
and after that i must to add a basic function in my container like thatCode:<a href="#">disclosures</a>
thank a lot for you answerCode:this.el.tap('click', function(e, t) { e.stopEvent(); // show the popup console.log('ok'); });
-
24 Jan 2013 12:44 PM #5
I'd suggest adding a css class to your anchor tag to identify how to handle it. Maybe "external" would be appropriate.
In the container that holds this html you will setup an event handler on the element like so:Code:<a href="#" class="external">Test</a>
The delegate is a CSS selector that will limit the handling to only anchor tags with a css class of external.Code:this.el.on('tap', function(e, t) { e.stopEvent(); console.log('stuff here'); }, this, {delegate: 'a.external'});Aaron Conran
@aconran
Sencha Architect Development Team
-
25 Jan 2013 6:48 AM #6
Thanks for your answer,
i just have a last little problem, it's impossible to setup an event handler in the container within Architect... :S. Maybe there is an another solution for do this ?
thank you so much


Reply With Quote