Results 1 to 5 of 5

Thread: How to get transactionId of Ajax request?

  1. #1

    Default How to get transactionId of Ajax request?

    Per the documentation for Ext.Ajax.request, it should return a transactionId. Although the following code successfully performs the request, it never returns a transactionId:

    Code:
                var id = Ext.Ajax.request({
                    url: 'Service.asmx/getAgencyData'
                    , method: 'POST'
                    , jsonData: { agencyId: pnl.getComponent('AgencyIdTextField').getValue()} 
                    , headers: { 'Content-Type': 'application/json;charset=utf-8'}
                    , success: function(response, options) {
                    }
                    , failure: function(response, options) {
                    }
                });
                Ext.Msg.alert('transactionId', id);   <--- this always has an empty object for id
    What am I missing?

  2. #2
    Sencha Premium User mrsunshine's Avatar
    Join Date
    Sep 2008
    Location
    Germany - Darmstadt
    Posts
    693

    Default

    Quote Originally Posted by dbassett74 View Post
    Ext.Msg.alert('transactionId', id);
    Ext.Msg.alert second parameter expected a String but Ext.Ajax.request returns a object which contains the id as attribute.

  3. #3

    Default

    I don't understand. I know that the return object is a Number, but i tried id.toString(), but that doesn't work either. Can you please elaborate a little for me? Thanks.

  4. #4
    Sencha User hendricd's Avatar
    Join Date
    Aug 2007
    Location
    Long Island, NY USA
    Posts
    5,966

    Default

    @dbassett74-- The return value from an Ext.Ajax.request is an object (this connection object returned from Ext.lib.Ajax, in fact). And yes, the documentation (for Ext.data.Connection) has been incorrect for quite a while.

    Code:
    var req = Ext.Ajax.request({....});
    Ext.Msg.alert('transactionId', req.tId);
    Pull up req in Firebug and snoop around.
    "be dom-ready..."
    Doug Hendricks

    Maintaining ux: ManagedIFrame, MIF2 (FAQ, Wiki), ux.Media/Flash, AudioEvents, ux.Chart[Fusion,OFC,amChart], ext-basex.js/$JIT, Documentation Site.


    Got Sencha licensing questions? Find out more here.


  5. #5
    Sencha User
    Join Date
    Apr 2010
    Posts
    99

    Default

    The doc for 3.x is still incorrect
    It still says that request() returns a Number while it returs the request object.

Posting Permissions

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