1. #1
    Sencha User
    Join Date
    Sep 2011
    Posts
    10
    Vote Rating
    0
    sanjay-patel is on a distinguished road

      0  

    Default Unanswered: Ext.create is not working in phonegap

    Unanswered: Ext.create is not working in phonegap


    Hi,

    I have used following code in assets/www/index.html

    <script type="text/javascript" charset="utf-8" src="cordova-1.5.0.js"></script>
    <script src="lib/touch/sencha-touch-all.js" type="text/javascript"></script>

    <link href="lib/touch/resources/css/sencha-touch.css" rel="stylesheet" type="text/css" />

    <script>

    document.addEventListener("deviceready", onDeviceReady, true);

    function onDeviceReady() {
    alert('onDeviceReady is called');

    Ext.setup({
    viewport: {
    autoMaximize: false
    },
    onReady: function() {
    alert('on ready is called')
    Ext.create('Ext.panel', {
    flex: 1,
    title: 'Panel title',
    html: 'Panel HTML'
    })

    }
    });
    }
    </script>

    It alerts "onDeviceReady is called" and "on ready is called"
    But after that is shows blank screen.

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,548
    Vote Rating
    872
    Answers
    3566
    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


    Are you using Sencha Touch 1 or 2? Ext.create is not the same between them.
    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 User
    Join Date
    Sep 2011
    Posts
    10
    Vote Rating
    0
    sanjay-patel is on a distinguished road

      0  

    Default


    Hi,
    I am using sencha touch 2. After using "sencha app build package" command, it works now.
    Thanks

  4. #4
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,548
    Vote Rating
    872
    Answers
    3566
    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


    Ok. Make sure you get in the correct forum. You posted in the ST1 forum, I have moved to the ST2 forum.
    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.

  5. #5
    Sencha User
    Join Date
    Sep 2011
    Posts
    10
    Vote Rating
    0
    sanjay-patel is on a distinguished road

      0  

    Default


    I have following code in app.js

    views: ['Main', 'CategoryContainer', 'LeftNavigationContainer'],
    stores: ['SCategoryList'],
    models: ['MCategoryList'],

    But I am getting following warning messages

    [WARN][Anonymous] [Ext.Loader] Synchronously loading 'PH.view.CategoryContainer'; consider adding 'PH.view.CategoryContainer' explicitly as a require of the corresponding class

    Console.js:35[WARN][Anonymous] [Ext.Loader] Synchronously loading 'PH.view.LeftNavigationContainer'; consider adding 'PH.view.LeftNavigationContainer' explicitly as a require of the corresponding class
    Console.js:35[WARN][Anonymous] [Ext.Loader] Synchronously loading 'PH.store.SCategoryList'; consider adding 'PH.store.SCategoryList' explicitly as a require of the corresponding class


    I am using "sencha-touch-2.0.1-rc"

    Thanks

  6. #6
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,548
    Vote Rating
    872
    Answers
    3566
    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


    You should add those classes to the require means. If a view requires a class, require it.
    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.

  7. #7
    Sencha User
    Join Date
    Sep 2011
    Posts
    10
    Vote Rating
    0
    sanjay-patel is on a distinguished road

      0  

    Default


    Hi,

    I have added following code in assets\www\index.html


    <include of sencha js and sencha css>

    <script type="text/javascript" src="cordova-1.5.0.js"></script>

    <script>
    document.addEventListener("deviceready",onDeviceReady,false);
    function onDeviceReady() {
    alert('onDeviceReady is called')
    }
    </script>

    But deviceready is not called.

    If I removed the <include of sencha js and sencha css> than deviceready is works.

  8. #8
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,548
    Vote Rating
    872
    Answers
    3566
    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


    You shouldn't need to listen for the deviceready event. Sencha Touch should be able to realize that phonegap is loaded.
    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.

  9. #9
    Sencha User
    Join Date
    Sep 2011
    Posts
    10
    Vote Rating
    0
    sanjay-patel is on a distinguished road

      0  

    Default


    Hi,

    I have downloaded the "Sencha Touch 2.0.1 FINAL" and "SDK Tool [Version 2.0.0 Beta 3 for Windows]"

    But I am getting the following error
    "[ERROR] Sencha SDK Tools 2.0.0-beta3 cannot be found from your system (SENCHA_SD
    K_TOOLS_2_0_0_BETA3 environment variable is not set). Please download and instal
    l version "2.0.0-beta3" of the tools from http://www.sencha.com/products/sdk-too
    ls . Close this terminal and open a new one after the installation is complete."

Thread Participants: 1

Tags for this Thread