1. #1
    Sencha User ThorstenSuckow's Avatar
    Join Date
    Sep 2007
    Location
    Aachen, Germany
    Posts
    595
    Vote Rating
    2
    ThorstenSuckow is on a distinguished road

      0  

    Post Ext.data.DirectProxy - where is the connection object?

    Ext.data.DirectProxy - where is the connection object?


    Can someone please tell me where a connection object gets instantiated when I configure Ext.data.Store to use with Ext.data.DirectProxy?

    Here's my store config:

    Code:
    var store = new Ext.data.Store({
        proxy : new Ext.data.DirectProxy({
            api : {
                read  : '/someurl',
                create: '/someurl',
                delete : '/someurl',
                update : '/someurl'
            }
        })
    })
    When I call "store.load()", it tries to to call "this.proxy.request(...)" but triggers an error, due to

    Code:
    var directFn = this.api[action] || this.directFn;
    ...
    directFn.apply(window, args);
    in DirectProxy.js' doRequest method - directFn holds an object with the api urls but thats about it, there is no connection object.


    What am I missing/doing wrong here?

  2. #2
    Ext JS Premium Member dj's Avatar
    Join Date
    Mar 2007
    Location
    Germany
    Posts
    576
    Vote Rating
    2
    dj has a spectacular aura about dj has a spectacular aura about dj has a spectacular aura about

      0  

    Default


    The js-doc for Ext.data.DirectProxy#api seams to be missing. DirectProxys use functions created by an Ext.direct.RemotingProvider - not urls.

    So either use an Ext.data.HttpProxy:
    Code:
    var store = new Ext.data.Store({
        proxy : new Ext.data.HttpProxy({
            api : {
                read  : '/someurl',
                create: '/someurl',
                delete : '/someurl',
                update : '/someurl'
            }
        })
    })
    or use Direct functions for the CRUD operations:
    Code:
    Ext.Direct.addProvider({
      type:'remoting',
      url:'/router',
      namespace:'App.direct',
      actions:[{...}]
    });
    
    ...
    
    var store = new Ext.data.Store({
        proxy : new Ext.data.DirectProxy({
            api : {
                read  : App.direct.some.function,
                create: App.direct.some.function,
                delete : App.direct.some.function,
                update : App.direct.some.function
            }
        })
    })
    Daniel Jagszent
    dɐɳiel@ʝɐgszeɳt.de <- convert to plain ASCII to get my email address

Thread Participants: 1

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar