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.
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.
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
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/GeoCongress
Aaron Conran
@aconran
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'); });
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
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