Results 1 to 2 of 2

Thread: Unable to access data in Callback (records)

  1. #1
    Sencha User
    Join Date
    Dec 2014
    Posts
    1

    Default Unable to access data in Callback (records)

    In my controller (code below)there is a load function that calls a web service and executes a stored procedure. I can see the data is being returned while using the debug (data in response body.) for the browser. The success = true displays 'In Success' from the alert. However the 'Records: ' records alert returns undefined. FYI - using ExtJS 4.2.1.883 version.

    What am I missing or what is needed to work with the data?

    Sample of what I see in response body:
    {"d":[{"Equip.WebServ.Models.EquipModelExt","LastReadDate":"\/Date(1432844760000)\/","EquipID":"Tank42","IsDirty":false}, {"Equip.WebServ.Models.EquipModelExt","LastReadDate":"\/Date(1432213200000)\/","EquipID":"TankKP","IsDirty":false}]}


    Code Snippet:
    load: function (OrderRecord, editLoc) {
    var me = this;
    me._editLoc = editLoc || false;
    me._OrderRecord = OrderRecord;
    var orderStatusStore = Ext.StoreManager.get('my.store.invOrderStatus');
    var modeStore = Ext.StoreManager.get('my.store.tran.Mode');
    orderStatusStore.proxy.api.read = serverVars.VMIObjectsWS + 'OrderStatus.asmx/SelectAll';


    if (OrderRecord.phantom) {
    var modeRec = modeStore.findRecord('Mode', 'rail', 0, true, false, true);
    OrderRecord.set('IxMode', modeRec.get('IxMode'));
    }


    var eqStore = Ext.StoreManager.get('my.store.equip.Equip');
    eqStore.proxy.api.read = serverVars.EquipWebService + 'Equip.asmx/SelectByIxLocationAndIxProduct';
    eqStore.proxy.extraParams.IxLocation = this._OrderRecord.get('IxLocation_Destination');
    eqStore.proxy.extraParams.IxProduct = this._OrderRecord.get('IxProduct');
    eqStore.proxy.extraParams.ActiveOnly = true;
    eqStore.load({
    callback: function (records, operation, success) {
    if (success == true) {
    alert('In Success');
    alert('Records: ' + records);
    }
    else {
    alert('failure loading Equip Store');
    }
    }
    });


    orderStatusStore.load({
    callback: function () {
    if (OrderRecord.phantom) {
    var statusRec = orderStatusStore.findRecord('Code', 'New', 0, false, false, true);
    OrderRecord.set('IxOrderStatus', statusRec.get('IxOrderStatus'));
    }
    me.show();
    }
    });
    },


    show: function () {
    // Other Code
    Ext.util.CloseLoadingDialog();
    },

  2. #2
    Sencha User joel.watson's Avatar
    Join Date
    Nov 2014
    Posts
    3,120
    Answers
    446

    Default

    Hi--

    What does your proxy's reader configuration look like?

    Thanks
    Joel

Similar Threads

  1. Replies: 11
    Last Post: 31 Oct 2012, 3:31 AM
  2. Replies: 3
    Last Post: 25 Oct 2012, 9:29 PM
  3. Unable to access data from Store.
    By shakti_remo in forum Ext 3.x: Help & Discussion
    Replies: 1
    Last Post: 23 Feb 2012, 6:50 AM
  4. callback from JSONP question - how to access data?
    By ngardner in forum Sencha Touch 1.x: Discussion
    Replies: 2
    Last Post: 9 Oct 2011, 12:24 PM

Tags for this Thread

Posting Permissions

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