无法更新我为特定PortfolioItem / MMF复制的所有PortfolioItem / Feature的父级

时间:2014-09-29 10:36:44

标签: javascript extjs extjs4 rally

我正在尝试为我为特定MMF复制的功能设置父级,但父级仅为最后一项功能设置。

设置父级的代码行 记录是新功能对象 _newParent是MMF对象,我做错了

record.set("Parent", _newParent.get("_ref")),

需要帮助。有什么建议吗?

整个方法就是这个

           _genericInnerCopy: function(_childObj) {
                that = this;
                model = that.model;
                var record = Ext.create(model, {
                    Name: _childObj.get('Name'),
                    //Parent: _newParent.get("_ref");,
                });
                record.save({
                    callback: function(result, operation) {
                        if(operation.wasSuccessful()) {
                            console.log("Done");
                            //that._copyChild();
                        } else {
                            console.log("error");
                        }
                    }
                })
                that._all_pis.push(record);
                console.log("all pis values", that._all_pis);
                var store = Ext.create('Rally.data.custom.Store', {
                    data: that._all_pis,
                    listeners: {
                        load: that._updateAll,
                        scope: that
                    },     
                });
                //console.log("record values", that._all_pis);
            },  
            _updateAll: function(store,data) {
                console.log("store values", store);
                console.log("data values", data);
                Rally.data.BulkRecordUpdater.updateRecords({
                    records: data,
                    propertiesToUpdate: {
                        Parent: _newParent.get("_ref")
                    },
                    success: function(readOnlyRecords){
                        //all updates finished, except for given read only records
                    },
                    scope: that
                });
                //that._createNewItems(that._all_pis);
            },

1 个答案:

答案 0 :(得分:0)

原始问题中的问题是您的代码没有吐出回调中的错误。要查看错误,可以使用console.log(operation.getError())或console.log(操作)并检查输出。