1. #1
    Sencha User
    Join Date
    Jun 2013
    Posts
    2
    Vote Rating
    0
    jeroenb3 is on a distinguished road

      0  

    Default Where to add remote provider?

    Where to add remote provider?


    Hi all,

    I'm using Ext JS 4.2 with Ext Direct using extdirectspring version 1.4.1.

    I'm adding the remove provider before the definition of the application like this:

    Code:
    Ext.require('Ext.direct.*', function() {
        Ext.Direct.addProvider(Ext.app.REMOTING_API);
    });
    I got this from an example and it works fine. But now I want to compile my into a single app.js using Sencha Cmd and I'm running into problems with Ext Direct. I understood that the line

    Code:
    Ext.Direct.addProvider(Ext.app.REMOTING_API);
    should actually be added to the launch function of the application, but when I do this I get errors saying "Uncaught ReferenceError: organisationServiceDirect is not defined", so for some reason my services like organisationServiceDirect in

    Code:
    proxy:{
            type:'direct',
            api: {
                read: organisationServiceDirect.getClients,
                create: organisationServiceDirect.addClient,
                update: organisationServiceDirect.updateClient,
                destroy: organisationServiceDirect.deleteClient
            }
    can no longer be found. I also tried adding the line Ext.Direct.addProvider(Ext.app.REMOTING_API); to the constructor of the application but this does not help either.

    Can someone please help me add the remoting provider correctly to the application so that i can compile my application?

    Thanks!

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


    The launch method is the proper place to use the addProvider method as the launch method is the method that will execute when all scripts are loaded (like your script for the api load). In your stores (or form api config) you should define strings and they will get resolved on first call of that api. You proxy should be:

    Code:
            proxy: {
            type: 'direct',
            api: {
                read: 'organisationServiceDirect.getClients',
                create: 'organisationServiceDirect.addClient',
                update: 'organisationServiceDirect.updateClient',
                destroy: 'organisationServiceDirect.deleteClient'
            }
    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
    Jun 2013
    Posts
    2
    Vote Rating
    0
    jeroenb3 is on a distinguished road

      0  

    Default


    Thanks! That was it...

Thread Participants: 1

Tags for this Thread