1. #1
    Sencha User
    Join Date
    Nov 2011
    Location
    Bhubaneswar, India
    Posts
    5
    Vote Rating
    0
    geektantra is on a distinguished road

      0  

    Default Unanswered: What would be the best way to include 3rd party components into a Sencha Touch App?

    Unanswered: What would be the best way to include 3rd party components into a Sencha Touch App?


    What would be the best way to include 3rd party components into a Sencha Touch 2 App?

    For example I want to add the 3rd party component https://github.com/mitchellsimoens/Ext.ux.touch.grid into a Sencha Touch 2 App.

    In the demo it says we can set the 'paths' config value to contain {'Ext.ux.touch.grid': '<relative/path/to/Ext.ux.touch.grid>'} but doing so gives the following error:
    Uncaught Error: [Ext.Loader] Failed loading 'http://localhost/app-path/www/sdk/src/ux/touch/grid/feature/Feature.js', please verify that the file exists

    Any help is appreciated.

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

      -1  

    Default


    It's all about the path for Ext.ux and where it points to. If you look at the examples I have it shows the path usage.
    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 abcd_ca's Avatar
    Join Date
    Aug 2011
    Posts
    22
    Vote Rating
    2
    abcd_ca is on a distinguished road

      0  

    Default What if it's not an extjs component

    What if it's not an extjs component


    what's the best way to load a 3rd party script, something that i don't want to port to a sencha touch class? Ideally I could lazily load it rather than sticking it in index.html

  4. #4
    Sencha User bluehipy's Avatar
    Join Date
    Mar 2010
    Location
    Romania
    Posts
    606
    Answers
    66
    Vote Rating
    26
    bluehipy will become famous soon enough bluehipy will become famous soon enough

      0  

    Default


    Quote Originally Posted by abcd_ca View Post
    what's the best way to load a 3rd party script, something that i don't want to port to a sencha touch class? Ideally I could lazily load it rather than sticking it in index.html

    First you specify it in app.json as a resource to assure that the external script will get copied along with other scripts.
    Second write code to lazy load the script, not using the Loader which requires you to have a class named as the script. You can use a Ajax request and an eval so you can be notified about the script loading phases.

  5. #5
    Sencha User
    Join Date
    Jan 2013
    Posts
    4
    Vote Rating
    0
    karensilkwood is on a distinguished road

      0  

    Default


    Hi Guys,

    I am curious, what do you mean on lazy loading the script files? I've included my 3rd party scripts in my app.json but I am getting an error saying that Uncaught ReferenceError: XY is not defined.


  6. #6
    Sencha User abcd_ca's Avatar
    Join Date
    Aug 2011
    Posts
    22
    Vote Rating
    2
    abcd_ca is on a distinguished road

      1  

    Default


    Lazy load just means that it doesn't get loaded right away, it gets loaded later. It's a general term with that meaning without specific implementation as it could be applied to any language. Lazy loading is an efficiency technique that lets you essentially spread out user wait time and bandwidth and/or only load what the user actually wishes to see. Simple example: Say you have 4 screens in your app but a user only navigates to two. Why load the other two up front?

  7. #7
    Sencha User
    Join Date
    Oct 2011
    Location
    Groningen, Netherlands
    Posts
    55
    Answers
    1
    Vote Rating
    0
    hermanvandermaas is an unknown quantity at this point

      0  

    Default


    You could try Ext.Load.loadScriptFile(), which supports both synchronous and asynchronous loading (and execution) of the script file.