View Full Version : Make the <href tel:> to work?

6 Dec 2011, 12:39 PM
Can Sencha Touch 2 make <a href="tel:+18009999999">call me</a> to work? I searched a little bit. To make a phone call through an app, I have to use PhoneGap. Some posts say it's a security reason. If so, can someone explain why phonegap can do it but not sencha touch?



6 Dec 2011, 1:21 PM
This was because ST2 wasn't allowing it. We are aware of it and will get fixed before final release.

6 Dec 2011, 4:09 PM
While href:tel may not be working right now you do have other options. For instance the following is example of what is working for me:

Ext.define('Test.view.Test', {
extend: 'Ext.Panel',
alias: 'widget.test',

config: {
fullscreen: true,
layout: {
type: 'vbox'

initialize: function() {
var me = this;
xtype: 'panel',
html: '<div>Phone: <span style="text-decoration: underline !important;" class="link" data-link="tel:+18887362421">1 (888) 736-2421</span></div>',
styleHtmlContent: true,
listeners: [
event: 'show',
scope: this,
fn: this.onPanelShow

onPanelShow: function(component, options) {
tap: function(event) {
var location = event.getTarget().getAttribute('data-link');
window.location = location;
delegate: '.link'

The important part here is listening for 'tap' on the components element and then using a delegate to specify exactly what item you want to listen for. In this case I'm listening for the tap event on any child elements with a class = 'link'.

Hope this helps