1. #1
    Sencha User
    Join Date
    Sep 2011
    Posts
    5
    Vote Rating
    0
    rich25200 is on a distinguished road

      0  

    Default 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.

  2. #2
    Sencha - Architect Dev Team aconran's Avatar
    Join Date
    Mar 2007
    Posts
    9,180
    Vote Rating
    119
    aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold

      0  

    Default


    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...

    Code:
    this.el.on('click', function(e, t) {
       e.stopEvent();
       // show the popup
    });
    stopEvent will stop the event from propagating and prevent the default action (follow the anchor link).
    Aaron Conran
    @aconran
    Sencha Architect Development Team

  3. #3
    Sencha - Architect Dev Team aconran's Avatar
    Join Date
    Mar 2007
    Posts
    9,180
    Vote Rating
    119
    aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold

      0  

    Default


    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
    Sencha Architect Development Team

  4. #4
    Sencha User
    Join Date
    Sep 2011
    Posts
    5
    Vote Rating
    0
    rich25200 is on a distinguished road

      0  

    Default


    thank you very much.

    Sorry but can you be more specific please.

    i have a hyperlink in my html code like that :

    Code:
    <a href="#">disclosures</a>
    and after that i must to add a basic function in my container like that

    Code:
    this.el.tap('click', function(e, t) {   e.stopEvent();
       // show the popup
        console.log('ok');
    });
    thank a lot for you answer

  5. #5
    Sencha - Architect Dev Team aconran's Avatar
    Join Date
    Mar 2007
    Posts
    9,180
    Vote Rating
    119
    aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold

      0  

    Default


    I'd suggest adding a css class to your anchor tag to identify how to handle it. Maybe "external" would be appropriate.

    Code:
    <a href="#" class="external">Test</a>
    In the container that holds this html you will setup an event handler on the element like so:
    Code:
    this.el.on('tap', function(e, t) {
       e.stopEvent();
       console.log('stuff here');
    }, this, {delegate: 'a.external'});
    The delegate is a CSS selector that will limit the handling to only anchor tags with a css class of external.
    Aaron Conran
    @aconran
    Sencha Architect Development Team

  6. #6
    Sencha User
    Join Date
    Sep 2011
    Posts
    5
    Vote Rating
    0
    rich25200 is on a distinguished road

      0  

    Default


    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

  7. #7
    Touch Premium Member BostonMerlin's Avatar
    Join Date
    Aug 2010
    Location
    Boston
    Posts
    515
    Vote Rating
    41
    BostonMerlin has a spectacular aura about BostonMerlin has a spectacular aura about BostonMerlin has a spectacular aura about

      1  

    Default


    In the init event of the top-most parent container, add the code.

    Quote Originally Posted by rich25200 View Post
    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

Thread Participants: 2

Tags for this Thread

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi