Sencha Touch 2 - prevent a-href events (a-href event handling)

前端 未结 1 1306
忘了有多久
忘了有多久 2021-01-12 13:40

In my Sencha Touch 2 application I need to handle redirection events on my own. By this I mean I need to be able to handle a href events and do the redirection myself.

<
相关标签:
1条回答
  • 2021-01-12 14:03

    I usually do this this way :

    Ext.Viewport.element.dom.addEventListener('click', function (e) {
        if (e.target.tagName !== 'A') {
            return;
        };
        e.preventDefault();
        var href = e.target.getAttribute('href');
    }, false);
    

    Try here

    Hope this helped

    0 讨论(0)
提交回复
热议问题