Results 1 to 9 of 9

Thread: about Ext-yui XHR utility

  1. #1
    Sencha User mysticav's Avatar
    Join Date
    Mar 2007
    Location
    Mexico
    Posts
    531
    Vote Rating
    50
      0  

    Default about Ext-yui XHR utility

    I would like to know if ext-yui provides an XHR utility similar to:
    http://ajaxtoolbox.com/

    basically it works like this:

    Ajax.makeRemoteCall(mydataObj, remoteurl, callback);

    function callback(response){
    .... do whatever yo want with response
    }

  2. #2
    Sencha User JeffHowden's Avatar
    Join Date
    Mar 2007
    Location
    Forest Grove, OR
    Posts
    1,038
    Vote Rating
    1
      0  

    Default

    Sure, look in the docs for the UpdateManager class.
    Jeff Howden
    Ext JS - Support Team Volunteer
    jeff@extjs.com

  3. #3
    Sencha User mysticav's Avatar
    Join Date
    Mar 2007
    Location
    Mexico
    Posts
    531
    Vote Rating
    50
      0  

    Default

    Well it doesn't look clear form me:

    Code:
    // Get it from a Ext.Element object
    var el = Ext.get("foo");
    var mgr = el.getUpdateManager();
    mgr.update("http://myserver.com/index.php", "param1=1&param2=2");
    ...
    mgr.formUpdate("myFormId", "http://myserver.com/index.php");
    How can I just make the call and get the response without involving elements at all?

    Or even better, how can you adapt this approach using yui-ext:

    Code:
    Ajax.makeRemoteCall(mydataObj, remoteurl, callback); 
    
    function callback(response){ 
    .... do whatever yo want with response 
    }

  4. #4
    Sencha User JeffHowden's Avatar
    Join Date
    Mar 2007
    Location
    Forest Grove, OR
    Posts
    1,038
    Vote Rating
    1
      0  

    Default

    If you're not looking to update an element, then you'll probably want to look into Ext.lib.Ajax.request() or Ext.lib.Ajax.formRequest() if you're working with form data.
    Jeff Howden
    Ext JS - Support Team Volunteer
    jeff@extjs.com

  5. #5
    Sencha User mysticav's Avatar
    Join Date
    Mar 2007
    Location
    Mexico
    Posts
    531
    Vote Rating
    50
      0  

    Default

    Thanks, but can you point me where can I read info. about this object ?

  6. #6
    Sencha User JeffHowden's Avatar
    Join Date
    Mar 2007
    Location
    Forest Grove, OR
    Posts
    1,038
    Vote Rating
    1
      0  

    Default

    There are no docs at this point. So, you'll need to look directly in /src/experimental/yui-bridge.js
    Jeff Howden
    Ext JS - Support Team Volunteer
    jeff@extjs.com

  7. #7
    Ext User
    Join Date
    Mar 2007
    Posts
    140
    Vote Rating
    0
      0  

    Default

    You can also use Ext.data.Connection. See my AjaxForm class for an example (update and submit functions).
    Belgabor's Ext Playground - Showcase for my Extensions

  8. #8
    Sencha User mysticav's Avatar
    Join Date
    Mar 2007
    Location
    Mexico
    Posts
    531
    Vote Rating
    50
      0  

    Default

    Yes. it works as expected. Just have a question:
    In the following code, I would like to know about the 'method' parameter.


    Code:
    var conn = new Ext.data.Connection({
    
                method: finalMethod,
                url: finalUrl
            });
    Also I need to know if its possible to make cross ajax calls (normally is not allowed).

    Thanks.

  9. #9
    Sencha User
    Join Date
    Mar 2007
    Posts
    7,854
    Vote Rating
    0
      0  

    Default

    Connection determines whether to do GET or POST based on whether you pass parms to the request. In addition, you can pass method:'GET' or method:'POST' to override that behavior. Read the source to see the implications of GET vs POST.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •