javascript - 将参数从 Rally.data.ModelFactory.getModel 传递给调用方法

标签 javascript extjs rally

需要这方面的帮助
从下面的代码中,我想将一些参数传递给调用函数,该函数是 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;

并且您不必将对其的引用作为参数传递。

关于javascript - 将参数从 Rally.data.ModelFactory.getModel 传递给调用方法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25929321/

相关文章:

javascript - 检查子域是否存在

javascript - 将图像从网络摄像头上传到服务器

javascript - 点击 Ext JS 打开/保存对话框

javascript - Rally:StandardCardRenderer 卡片样式

javascript - 使用 Python 在远程网站上触发 Javascript 事件

javascript - Extjs 存储不适合 JSON

javascript - 如何从javascript中的字符串中获取数字?

api - 从 RallyDev 检索附件

java - 拉力赛(Java): I dont want to add a testresult if there is one already in the testcase

javascript - D3 折线图的解析日期 "2013-07-11T00:00:00"