Scrolling External Web Pages in Sencha Touch

This is the solution to the issue with scrolling External Web Page links in Sencha Touch 🙂

Problem : 

I’ve been trying for the past 2 weeks now to load an external web page into my Sencha Touch app for iOS/Android/BB devices. But if you use the <iframe src …. > way then the sencha panel/frame/anything-actually  DOES NOT SCROLL. 

Tried & Failed Attempts :

  1. <iframe  scrolling=”yes|auto”> :- DID NOT SCROLL
  2. Ext.Panel({ scroll:’vertical’ }); : DID NOT SCROLL
  3. Ext.Panel({ scrollable : true  }); :- DID NOT SCROLL
  4. Tried Ext.XTemplates (every possible permutation and combination in the world) :- DID NOT SCROLL

Here’s what finally worked :

Solution : 

one the panel show listener event call :

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

Wonder of wonders it worked !!!

EDIT : Works only for external files stored on the same domain.

Advertisements

10 thoughts on “Scrolling External Web Pages in Sencha Touch

  1. I have been on blogs all day no when has solved this Sencha says it can not be done. Can provide more of your code snippet?

    • I did provide my code snippet. What exactly isnt working for you ?? Paste your code here and lets take a look at it.

      • Hi Sasha,

        Thanks for your reply. I have since changed how am solving this problem I am no longer using iFrame,

        Cheers!

      • Hi. Can you please provide me your snippet as well? I would really like to know how you used it in context..

        Thx in advance.

  2. Yeah, it works…but It’s not the original (web) page, but the content of that page rendered in the Ext.Panel. But it’s a solution, surely.

    Have you any update about this problem?

    • I’ve started using ChildBrowser (the Phonegap Plugin) to open any external domain files. Then you get the entire capability of the browser whilst remaining in your own application.

    • You can use it with any object that ultimately uses a panel/container as its parent class. So yes, it would work with a carousel too 🙂

Leave a message :)

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s