문제

I am running into a strange problem with not being able to update properties on an object that is returned as part of a deferred promise.

// Update or Insert status information into the idr_status table
this.updateStatus = function (idrInspData, statusId, submitting)
{
    var def = new $.Deferred();
    self.getIdrStatus (idrInspData.idr_date).done (function (idrStatus)
    {
        //status record exists for the day update record
        idrStatus.status_msg_id = statusId;
        idrStatus.submitted = submitting ? 1 : 0;
        idrStatus.modified = 1;

        idrStatus.action_needed = statusId.search('+') != -1 ? true : false;

        // update the status
        self.db.updateRecord (self.idrStatusTableName, idrStatus).always (
            function (updateResult)
            {
                def.resolve(true);
            });

    }).fail (function (result)
    {
       def.reject(result);
    });

    return (def.promise ());
}

The idrStatus object is returned from a SQLite resultset and then converted to a plain JS object then resolved to the done function above. The object comes in but any attempt to edit the properties are simply ignored and the same object is passed Unchanged to the updateRecord function. I am puzzled? Why would the object be locked?

올바른 솔루션이 없습니다

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top