2012-01-12 6 views
2

내 Sencha Touch 앱의 iframe에 외부 웹 페이지를로드하려고합니다. 웹 페이지는 동적 인 높이이므로 iframe이 sencha touch 앱 내에서 스크롤 할 수 있어야합니다. 페이지를 스크롤 할 수 있었지만 기본 iframe은 초기 웹 내용 인 viewport을 렌더링하지 않습니다. 여기 내 코드가있다. 아무도 아이디어가 있니?스크롤로 iframe을 iframe에 표시했습니다.

App.views.Help = Ext.extend(App.views.Base, { 
    title: 'Help', 
    mainLevel: 10, 
    subLevel: 1, 
    backButton: 'dashboard', 
    forceTab: App.OTHER_TAB, 
    forceSideTab: App.HELP_TAB, 
    layout: 'fit', 
    bodyPadding: 0, 
    items: [{ 
     xtype: 'panel', 
     scroll: 'both', 
     items: [{ 
      id: 'iframe', 
      layout: 'vbox', 
      width: '100%', 
      height: '2000px', 
      html: [ 
       '<div style="width:100%;height:2000px;position:fixed;top:0;left:0;background-color:Transparent;float:left;z-index:99;"></div>', 
       '<iframe style="position:fixed;top:0;left:0;float:left;z-index:1;" width="100%" height="2000px" src="http://mvretail.assistly.com/customer/portal/topics/118700-mobile-basics"></iframe>' 
      ] 
     }] 
    }] 

/* OLD attempts 
    html: '<iframe style="overflow-y: scroll; -webkit-overflow-scrolling: touch"  width="1000px" height="1200px"  src="http://mvretail.assistly.com/customer/portal/topics/118700-mobile-basics"></iframe>' 

    html: '<div style="overflow-y: scroll; -webkit-overflow-scrolling: touch"><iframe  width="1000px" height="1000px" src="http://mvretail.assistly.com/customer/portal/topics/118700-mobile-basics"></iframe> </div>' 
*/ 

}); 
+1

나는 어떤 문제라도 해결할 수 있습니까? @Josh – virsir

답변

0

아, 친숙한 문제. 나이를 시도하고 시도한 후에, 나는 이것을 알아 냈습니다. 여기에 블로그 게시물에 대한 링크는 내가 다른 사람을 위해이 문제를 해결 (자신 여기

Tech-Talk-Tone : Scrolling External Webpages in Sencha Touch with iFrames & More하기 위해 만든 수정 :

Ext.Ajax.request({ 
       url: ‘your/external/web/page/url.html’, 
       success: function(response, opts) { 
        Ext.getCmp(‘YourPanelId’).update(response.responseText); 
       } 
}); 

는 당신이 필요로하는, 외부 링크에 대해이 작업을하려면 것입니다 (또는 Phonegap)을 호스트하는 서버에서 크로스 도메인 또는 크로스 브라우저 Ajax 요청을 사용 가능하게 설정하면됩니다. :)

+0

동일한 출처의 콘텐츠에 액세스하거나 CORS를 사용하는 경우에만 해당됩니다. –

관련 문제