Success! Looks like we've fixed this one. According to our records the fix was applied for TOUCH-2868 in a recent build.
  1. #1
    Sencha User
    Join Date
    Mar 2012
    Location
    Leeuwarden, Netherlands
    Posts
    20
    Vote Rating
    0
    fokkezb is on a distinguished road

      0  

    Default Ext.browser.is.WebView should be false for Ext.os.is.Desktop

    Ext.browser.is.WebView should be false for Ext.os.is.Desktop


    REQUIRED INFORMATION


    Ext version tested:
    • Sencha Touch 2.0.1

    Browser versions tested against:
    • Safari 5.1.5
    • PhoneGap 1.5.0

    DOCTYPE tested against:
    • HTML5

    Description:
    • If you add the PhoneGap script tag to your index.html and require Ext.device.Device, you'll get the following error:
      Code:
      JavaScript error: ReferenceError: Can't find variable: device on line 10 for sdk/src/device/device/PhoneGap.js
      . This is because the Ext.browser.is.WebView flag only checks for the existence of window.PhoneGap (or Cordova), while it should also check if we're in fact on a phone. Because it doesn't, the Ext.device.* classes construct the PhoneGap subclasses. And since Ext.device.Device.PhoneGap tries to read device.* upon construction.. it fails.

    Steps to reproduce the problem:
    • Create a blank app
    • Add the PhoneGap/Cordova script and script-tag
    • Open the app on your desktop (or try to sencha app build package it).

    The result that was expected:
    • Use of the Ext.device.*.Simulator classes

    The result that occurs instead:
    • Use of the Ext.device.*.Phonegap classes
    • The described error

    HELPFUL INFORMATION


    Debugging already done:
    • Hours of trail and error

    Possible fix:
    • Only set the WebView flag if we're on a phone

    Additional CSS used:
    • only default ext-all.css

    Operating System:
    • Mac OS X Lion

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,412
    Vote Rating
    850
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    Thank you for the report.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha - Sencha Touch Dev Team rdougan's Avatar
    Join Date
    Oct 2008
    Posts
    1,158
    Vote Rating
    6
    rdougan will become famous soon enough

      0  

    Default


    Fixed for the next release. Thanks!
    Sencha Inc.
    Robert Dougan - @rdougan
    Sencha Touch 2 and Ext JS 4 Core Team Member, SASS/Theming Wizard.

Thread Participants: 2