1. #1
    Sencha User
    Join Date
    Mar 2010
    Posts
    41
    Vote Rating
    2
    heratech is on a distinguished road

      0  

    Default Sencha Cmd + Ext.Direct

    Sencha Cmd + Ext.Direct


    What is the best way to compile an application with Ext.direct? For now I have a script called api.js
    that I include after ext-dev.js and before app.js. That script has all the actions and then does the Ext.direct.Manager call:




    Code:
    Ext.ns('Ext'); Ext.php = {    "url":"\/extdirect\/router",    "type":"remoting",    "enableBuffer":true,    "actions":{
    ....Ext.require('Ext.direct.*', function() {    Ext.direct.Manager.addProvider(Ext.php);});
    I also had to go through and change all directFn: lines to strings, not functions (in sencha architect).

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


    Code:
    Ext.direct.Manager.addProvider(Ext.php);
    Should really be within the launch method of Ext.application.
    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
    Mar 2010
    Posts
    41
    Vote Rating
    2
    heratech is on a distinguished road

      0  

    Default


    Hi,
    I am reasonably sure I tried that and had issues. I think some of my stores were trying to load before? Or maybe it was before I changed all the directFn: Function lines to directFn: 'string'.

  4. #4
    Sencha Premium Member
    Join Date
    Apr 2008
    Posts
    269
    Vote Rating
    31
    themightychris has a spectacular aura about themightychris has a spectacular aura about

      0  

    Default


    See if anything in my thread helps, they've marked it as "Fixed": http://www.sencha.com/forum/showthread.php?247318
    Chief Architect @ Jarv.us Innovations
    Co-captain @ Code for Philly

    Jarvus builds and optimizes top-quality Sencha Touch and ExtJS apps for open-source projects and clients of all sizes.

    Don't waste time with bugs that have already been found and fixed by the community, compile our tried and tested hotfixes packages into all your projects: https://github.com/JarvusInnovations/sencha-hotfixes

  5. #5
    Sencha User
    Join Date
    Jan 2012
    Location
    Moscow
    Posts
    10
    Vote Rating
    2
    odibo is on a distinguished road

      0  

    Default


    I place Ext.direct.Manager.addProvider into the constructor method of my application and it works fine with dynamic class loading, as well.

    Code:
    Ext.define('school.Application', {
        
        name: 'school',
    
        extend: 'Ext.app.Application',
        
        requires: ['Ext.direct.*'], 
        
        autoCreateViewport: true,
        
        constructor: function(config) {
            
            config = config || {};
    
            (function applyMultipleNamespacesOfRemoteApi (apiNamespace){
    
                Ext.Object.each(apiNamespace, function(key, value, object) {
    
                    if (key == 'REMOTING_API') {
                        Ext.direct.Manager.addProvider(value);
                    } else {
                        applyMultipleNamespacesOfRemoteApi(value); // recursive call
                    }
    
    
                });
    
            })(Ext.remote);
    
    
            this.callParent([config]);
    
        },
    
        views: [],
    
        controllers: [],
        
        models: [],
    
        stores: []
        
    });