Last Updated: February 25, 2016
·
2.086K
· rdougan

Prevent links from opening with Sencha Touch/ExtJS

This can be useful if you want all links on your page to open differently (like in PhoneGap).

Ext.each(Ext.query('a'), function(el) {
    el = Ext.get(el);
    el.on('click', function(e) {
        e.preventDefault();
        console.log('clicked', el.getAttribute('href'));
    });
});