2012-05-30 1 views
3

전자 메일, 전화 및 SMS 기능을 구현하려고하는 샘플 Sencha Touch 응용 프로그램이 있지만 응용 프로그램을 실행할 때 전자 메일 창이나 호출 창을 열 수 없습니다. 제대로 작동하도록 올바른 구문을 알 수 있습니까?Sencha Touch에서 전자 메일, 전화 기능을 구현하는 방법

샘플 코드 :

Ext.define('Sample.view.ContactsView', { 
    extend:'Ext.Panel', 
    requires:[ 
    'Ext.form.FieldSet', 
    'Ext.field.Text' 
    ], 

    alias:"widget.contactpage", 
    initialize:function() { 
    this.callParent(arguments); 
    }, 

    config:{ 
    items:[ 
     { 
     xtype:'titlebar', 
     title:'Contact Us' 
     }, 
     { 
     xtype:'panel', 
     layout:'hbox', 

     items:[ 
      { 
      xtype:'button', 
      flex:1, 
      id:'smsButton', 
      handler:function(){ 
       document.location.href = 'sms:464646' 
      } 
      }, 
      { 
      xtype:'spacer' 
      }, 
      { 
      xtype:'button', 
      text: 'Phone', 
      id:'callMeButton', 
      flex:1, 
      handler:function(){ 
       document.location.href = 'tel:+1-800-555-1234' 
      } 
      } 
     ] 
     }, 
     { 
     xtype:'button', 
     text:'Email', 
     id: 'emailButton', 
     handler:function(){ 
      document.location.href = 'mailto:[email protected]' 
     } 
     } 
    ] 
    }, 
}); 

답변

7

사용 window.open() 메소드.

window.open('tel:+1-800-555-1234'); 
window.open('mailto:[email protected]'); 
+1

감사합니다, 심지어이 { 하기 위해 xtype을 작동 = 'tel : 999999'; } } – mahesh

+0

@Swar 통화 종료 후 다시 전화를 걸 수있는 방법이 있습니까? 그래서 나는 통화 시간을 잡아 내 데이터베이스에 저장할 수 있습니다. – Dibish

+0

전자 메일 컨텐츠를 준비하려면 어떻게해야합니까? 같은 것이 있습니까 : window.open ('mailto : [email protected] content : here is the content') – Franva

0

당신은 자동으로 소환합니다 링크를 누르면 전자 메일

<a href="mailto:[email protected]">[email protected]</a> 

전화 번호

<a href="tel:+1-800-555-1234">+1-800-555-1234</a> 

위해 <a> 태그

를 사용하여이 작업을 수행 할 수 있습니다 안드로이드 및 iOS 모두에서 전화 앱 또는 전자 메일 앱. '버튼', 플렉스 : 1, 텍스트 : '전화', ID : 'phoneButton', 핸들러 : 함수() { 에서는 window.location 답장을

관련 문제