Sencha Touch v1 Open Links in New Windows

Just add this snippet to your code if you want to force all links in your panels to open in a new window.   I’m targeting links specifically, but you could use it on just about anything.

Ext.override(Ext.Panel, {
  listeners : {
    click: {
      element: 'el',
      fn: function (e) {
        if (e.target.tagName === 'A') {
          e.stopEvent();
          window.open(e.target.href);
        }
      }
    }
  }
});

©2005-2017 Blog – Epiphany Digital is proudly powered by Badgers and Web Design is by Epiphany Digital
Entries (RSS) and Comments (RSS). 36 queries. 3.991 seconds.

Thank you for visiting this site. The web fairy will visit you in your sleep... you know, I was going somewhere with this, but it really doesn't have as much innocent charm as the tooth fairy, especially when I picture the web fairy as someone much like the Simpsons' Comic Book Guy but with wings. It's just not something I want.