将参数从Rall.data.ModelFactory.getModel传递给调用方法

pass parameters from Rally.data.ModelFactory.getModel to calling method

本文关键字:调用 方法 getModel ModelFactory 参数 Rall data      更新时间:2023-09-26

需要帮助
从下面的代码中,我想将一些参数传递给调用函数genericInnerCopy但我不能传递参数,默认情况下,模型作为参数传递

                var that = child;
                that._type = 'PortfolioItem/' + that.get('PortfolioItemTypeName');
                Rally.data.ModelFactory.getModel({
                    type: that._type,
                    success: this.genericInnerCopy,
                    scope: this
                });  

在下面的方法中,我想使用上面方法中的子对象

                genericInnerCopy: function(model) {
                this.model = model;
                var record = Ext.create(this.model, {
                    Name: child.get('Name'),
                });
                record.save;
                },

对此有任何建议。提前谢谢。

假设this指向应用程序,

var that = this;

你可以创建一个在应用程序中任何地方都可用的对象:

that._child = child;

并且您不必将引用作为参数传递给它。