Menu

Dynamically setting call,sms, email functionality in sencha touch

March 24, 2015 - sencha touch 2

SMS functionality

{
xtype: 'button',
flex: 1,
ui: 'action',
text: 'SMS',
id: 'smsButton',
handler: function () {
window.location = 'sms:**99999999**';
}

}

Call Functionality

{
xtype: 'img',
text: 'Phone',
src: 'http://src.sencha.io/x30/x30/https://support.skype.com/assets/20120601134928/images/categories64/call.png',
id: 'callMeButton',
flex: 3,
tap: function () {
window.location = 'tel:**999999999**';

}

}

Email Functionality:

{
xtype: 'button',
text: 'Email',
ui: 'action',
flex: 1,
id: 'emailButton',
handler: function () {
`window.location = 'mailto:`**example@gmail.com**';

}
}

To store via variable

Store your values of sms number, email address and call number in some address like shown below ..

var contactNo = "**9999999**";
var emailId = "example@gmail.com";
var smsNo = "**99999999**";
and then make call as shown below,

window.location.href = "sms:"+smsNo;
window.location.href = "mailto:"+emailId;
window.location.href = "tel:"+contactNo;

Leave a Reply