1. #1
    Sencha Premium Member
    Join Date
    Aug 2012
    Location
    California
    Posts
    28
    Vote Rating
    1
    thejonz is on a distinguished road

      0  

    Default Unanswered: Pass a parameter to callback function in Architect?

    Unanswered: Pass a parameter to callback function in Architect?


    Is it possible to pass a parameter to a callback function (I need to be able to use 'this' in my callback method )?

    Here's my call (that isn't passing a parameter yet). I know I can make the callback function inline (and use a local variable that = this) but I call it all over so I'd rather not duplicate the code.

    workOrders.load(
    {
    params: {
    sessionID: sessionID,
    resNum: num
    },
    callback: this.displayWorkOrders
    });

  2. #2
    Sencha Premium Member
    Join Date
    Aug 2012
    Location
    California
    Posts
    28
    Vote Rating
    1
    thejonz is on a distinguished road

      0  

    Default How I solved this

    How I solved this


    ok, maybe there is a way to pass parameters to callback function but I haven't been able to find out how. In the meantime, this is how I solved my problem - I changed my callback function to an inline function and then have that callback function call another function. I like this because I don't have to duplicated the function that is now called in the callback everywhere.

    var that = this;

    workOrders.load(
    {
    params: {sessionID: sessionID, relatedResNum: resNum},
    callback: function(record, operation, success)
    {
    that.displayWorkOrders(record, operation, success, that);
    }
    });

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