1. #1
    Sencha User
    Join Date
    Mar 2011
    Posts
    30
    Vote Rating
    1
    sidamos77 is on a distinguished road

      0  

    Default DirectProxy example needed

    DirectProxy example needed


    I have searched the internet up and down to find an ExtJs DirectProxy example. Even one for 3.x would be great.

    I need explanation for instance, how to code the directFn function and what directFn.directCfg.method is.

    I got a directFn working, but what are the parameters that I get? One seems to be callback function. What parameters does this need?

    There is severe lack of documentation about this, I guess.

    Thanks!

  2. #2
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    16,645
    Vote Rating
    583
    evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute

      0  

    Default


    There are several direct examples in the b1 download. Under /direct
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

  3. #3
    Sencha User
    Join Date
    Mar 2011
    Posts
    30
    Vote Rating
    1
    sidamos77 is on a distinguished road

      0  

    Default


    Thanks for the pointer. I had searched in examples, but did not find it, because I only searched for "DirectProxy" instead of "type: 'direct'".

    In those examples, what is that "TestAction"? I cannot find it declared anywhere.

  4. #4
    Sencha User steffenk's Avatar
    Join Date
    Jul 2007
    Location
    Haan, Germany
    Posts
    2,656
    Vote Rating
    6
    steffenk has a spectacular aura about steffenk has a spectacular aura about steffenk has a spectacular aura about

      0  

    Default


    did you looked in examples/direct? Everything is in, TestAction is the direct method in php.
    vg Steffen
    --------------------------------------
    Release Manager of TYPO3 4.5

  5. #5
    Sencha User
    Join Date
    Mar 2011
    Posts
    30
    Vote Rating
    1
    sidamos77 is on a distinguished road

      0  

    Default


    Thanks. Got it. I had only looked in the .js files.

    I am no php expert. TestAction seems like a server side class that can be remotely called by js, I guess.

    But what about directFn.directCfg.method? Or even directCfg? I can't find that in the examples.

  6. #6
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    16,645
    Vote Rating
    583
    evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute

      0  

    Default


    It's an internal thing, you shouldn't touch it.
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

  7. #7
    Sencha User
    Join Date
    Mar 2011
    Posts
    30
    Vote Rating
    1
    sidamos77 is on a distinguished road

      0  

    Default


    OK, but I get an exception from ExtJs Beta 1 at line 38490 of ext-all-debug.js:

    Code:
    method = fn.directCfg.method;
    fn.directCfg is undefined.

    Code:
        var getData = function() {
          console.info('DirectProxy callback!');
          console.info(arguments);
        }
        var bufferStore = new Ext.data.BufferStore({
            id: 'bufferStore',
            pageSize: 200,
            model: 'Artikel',
            remoteSort: true,
            proxy: {
                type: 'direct',
                directFn: getData,
                model: 'Artikel'
            }
        });
    
    [...]
    
        bufferStore.guaranteeRange(0, 199);

  8. #8
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    16,645
    Vote Rating
    583
    evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute

      0  

    Default


    Because you haven't set it up properly. The directFn isn't a regular function, have a look through the examples.
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

  9. #9
    Sencha User
    Join Date
    Mar 2011
    Posts
    30
    Vote Rating
    1
    sidamos77 is on a distinguished road

      0  

    Default


    Hmm, I don't see this special setup. Any more pointers would be greatly appreciated.

  10. #10
    Sencha User
    Join Date
    Mar 2011
    Posts
    30
    Vote Rating
    1
    sidamos77 is on a distinguished road

      0  

    Default


    OK, I finally found this page, which explains some things:
    http://www.sencha.com/blog/ext-js-30...-for-everyone/

    However, this page (Direct specs) does not exist (anymore):
    http://www.sencha.com/products/extjs/direct.php

    I am beginning to understand what ExtJs Direct is and I think now, that this does not fit our needs, because we already have a remoting solution: DWR

    So, the question is: How can I get a callback from a Ext.data.BufferStore, when it needs data, so that I can call an existing DWR method to fetch the data?

Similar Threads

  1. DirectProxy need work
    By mitchellsimoens in forum Ext: Discussion
    Replies: 35
    Last Post: 16 Mar 2011, 6:50 AM
  2. [API] [PR4] DirectProxy missing
    By mitchellsimoens in forum Ext:Bugs
    Replies: 2
    Last Post: 16 Mar 2011, 6:47 AM
  3. DataWriter Example does not work with DirectProxy
    By jcalfee in forum Ext.Direct
    Replies: 4
    Last Post: 12 Oct 2010, 12:40 PM
  4. How to use PARAMS with Ext.data.DirectProxy
    By kpopov in forum Ext.Direct
    Replies: 1
    Last Post: 10 Sep 2009, 1:44 PM

Thread Participants: 2