在使用 Titanium 的 Alloy 框架时,模型使用 Backbone.js。我是 Backbone.js 和 Alloy 的新手。
但是我对 ExtJS 很熟悉,在 ExtJS 中,您可以创建一个表单,然后说如下内容:
form.loadRecord(record); // where record is an instance of a model
接着
form.getRecord(record); // When you're saving the form, get the record
var vals = form.getValues(); // And then get the values from the form that the user changed
record.setValues(vals); // Update your record with whatever values the user changed.
所以我的问题是,合金中的表格模式是什么?还是没有?
我可以轻松地制作自己的函数,但是在尝试将模型绑定到这样的表单对象时,我遇到了应用程序崩溃的问题:
that.model = model; // where model was passed in to the form.loadRecord function.