1. #1
    Ext JS Premium Member
    Join Date
    Jun 2010
    Location
    Ireland
    Posts
    43
    Vote Rating
    0
    ospillane is on a distinguished road

      0  

    Default Is it possible to use Sencha SDK and Sandbox mode

    Hi,
    I want to use Sencha SDK to deploy my app but I need to use the Sandbox version of ExtJS4. I keep getting an error saying that 'Ext is not defined'. The app and the build worked perfect when I was including ext-debug.js, but when I switch to any of the sandbox files, I just get the error on the build.
    Does anyone know if this should be possible or not?
    Thanks,
    Orla

  2. #2
    Sencha User
    Join Date
    Jul 2009
    Posts
    14
    Vote Rating
    0
    tinabucur is on a distinguished road

      0  

    Default

    Did anybody tried to modify existing ext-debug.js file in order to work in sandbox mode?

  3. #3
    Ext JS Premium Member
    Join Date
    Jun 2010
    Location
    Ireland
    Posts
    43
    Vote Rating
    0
    ospillane is on a distinguished road

      0  

    Default

    I have not tried to modify this. JSBuilder definitely does not support Sandbox mode at present, I'm hoping Sencha will provide this is a future release.

  4. #4
    Sencha User
    Join Date
    Jul 2009
    Posts
    14
    Vote Rating
    0
    tinabucur is on a distinguished road

      0  

    Default

    Hi ,

    I managed to use ext-debug.js in sandbox mode. All you need to do is to add around the existing source code with the following :
    Code:
    (function(Ext){
    if (typeof Ext === 'undefined') {
    this.Ext = {};
    }
    
    Ext.buildSettings = {"baseCSSPrefix":"x4-","scopeResetCSS":true};
    Ext.isSandboxed = true;
    
    //ext-debug.js content 
    
    })(this.Ext4 || (this.Ext4 = {}));
    Hope this helps
    Cristina

  5. #5
    Sencha User
    Join Date
    Mar 2012
    Posts
    8
    Vote Rating
    0
    BrunoSales is on a distinguished road

      0  

    Default the problem persists?

    Hi,

    I wonder if this problem persists in version 2.0.0-beta3.


    I am awaiting.

    Thanks,

  6. #6
    Sencha Premium Member
    Join Date
    Nov 2013
    Posts
    2
    Vote Rating
    2
    wajb is on a distinguished road

      2  

    Default

    After almost an entire day of trying to achieve it manually I discovered there is a sandbox build command in Sencha Cmd v4.0.1.45!

    There are loads of ways you could set this but adding the following line to ${app.dir}/.sencha/app/sencha.cfg is pretty simple:
    Code:
    build.concat.options=-sandbox=Ext4:x4-
    (These options are used with the compile "concatenate" command.)

    It's a shame Sencha failed to document this option; although I appreciate sandboxing isn't recommended for release for transitional reasons we're doing it anyway.
    Last edited by wajb; 29 Nov 2013 at 8:46 AM. Reason: Removed statement saying CSS is sandboxed

  7. #7
    Ext JS Premium Member
    Join Date
    Jul 2011
    Posts
    46
    Vote Rating
    4
    adrianmirjan is on a distinguished road

      1  

    Default

    Thank you! This works for me.

  8. #8
    Sencha Premium Member
    Join Date
    Jan 2013
    Location
    Europe
    Posts
    62
    Vote Rating
    69
    mbingham is just really nice mbingham is just really nice mbingham is just really nice mbingham is just really nice

      1  

    Default

    Thanks wajb, very fruitful indeed!

    Code:
    build.concat.options=-sandbox=Ext4:x4-
    So Ext4 becomes the name of the Ext global object.

    And x4 becomes Ext.buildSettings.baseCSSPrefix

    Then I set $prefix: 'x4' in sass/var/all.scss. Perfect.

  9. #9
    Sencha User
    Join Date
    Oct 2012
    Posts
    3
    Vote Rating
    0
    firnnauriel is on a distinguished road

      0  

    Default

    Quote Originally Posted by mbingham View Post

    Then I set $prefix: 'x4' in sass/var/all.scss. Perfect.
    I'm not clear on how to change the final output CSS to include the 'x4' prefix. I tried creating an all.scss in the folder you mentioned then do 'sencha app build'. The output resources/appname-all.css doesn't contain the 'x4-'. Could you tell me where am I doing wrong?

  10. #10
    Sencha Premium Member
    Join Date
    Jan 2013
    Location
    Europe
    Posts
    62
    Vote Rating
    69
    mbingham is just really nice mbingham is just really nice mbingham is just really nice mbingham is just really nice

      0  

    Default

    Good spot! There were some changes made in Sencha Cmd 5.1 release.

    Now additionally, you must open .sencha/app/sencha.cfg

    Add a new line in there like this: build.optimize.cssPrefix=false

    Sencha have documented it as an optimization change affecting Ext.baseCSSPrefix, see:

    http://www.sencha.com/blog/announcing-ext-js-51-beta/ (CTRL+F for basecssprefix)