Skip to content

Passing in 'state' to the Async methods

EntitySpaces edited this page Jan 22, 2012 · 1 revision
    var emp1 = new es.objects.Employees();
    emp.loadByPrimaryKey({ 
        employeeId: 2, 
        success: function (data, state) {
            var myState = state;
            console.log(myState); // 'SomeValue'
        }, 
        error: function (status, responsText, state) {
            var myState = state;
            console.log(myState); // 'SomeValue'
        }, 
        state: 'SomeValue' 
    });