Javascript 钛合金骨架与ACS
我正在尝试将数据从Appcelerator云服务传递到主干模型。我找不到有关如何执行此操作的文档 下面是我的模型文件中的配置:Javascript 钛合金骨架与ACS,javascript,android,ios,backbone.js,titanium-alloy,Javascript,Android,Ios,Backbone.js,Titanium Alloy,我正在尝试将数据从Appcelerator云服务传递到主干模型。我找不到有关如何执行此操作的文档 下面是我的模型文件中的配置: exports.definition = { config: { "columns": { "id":"integer", "address":"text", "user_completed":"integer" }, "adapter": {
exports.definition = {
config: {
"columns": {
"id":"integer",
"address":"text",
"user_completed":"integer"
},
"adapter": {
"type": "", //what can I enter?
"collection_name": "places"
}
},
extendModel : function(Model) {
_.extend(Model.prototype, {
validate : function(attrs) {
for (var key in attrs) {
var value = attrs[key];
if (value) {
if (key === "item") {
if (value.length <= 0) {
return 'Error: No item!';
}
}
if (key === "done") {
if (value.length <= 0) {
return 'Error: No completed flag!';
}
}
}
}
}
});
return Model;
},
extendCollection : function(Collection) {
_.extend(Collection.prototype, {
comparator: function(places) {
return places.get('done');
}
});
return Collection;
}
};
exports.definition={
配置:{
“栏目”:{
“id”:“整数”,
“地址”:“文本”,
“用户_已完成”:“整数”
},
“适配器”:{
“type”:“”//我可以输入什么?
“集合名称”:“地点”
}
},
扩展模型:函数(模型){
_.扩展(模型、原型、{
验证:函数(attrs){
for(属性中的变量键){
var值=属性[键];
如果(值){
如果(键==“项目”){
如果(value.length您需要在配置中使用“acs
”
选中此项:
exports.definition = {
config: {
"columns": {
"id":"integer",
"address":"text",
"user_completed":"integer"
},
"adapter": {
"type": "acs", // Use "acs"
"collection_name": "places"
}
},
extendModel : function(Model) {
_.extend(Model.prototype, {
validate : function(attrs) {
for (var key in attrs) {
var value = attrs[key];
if (value) {
if (key === "item") {
if (value.length <= 0) {
return 'Error: No item!';
}
}
if (key === "done") {
if (value.length <= 0) {
return 'Error: No completed flag!';
}
}
}
}
}
});
return Model;
},
extendCollection : function(Collection) {
_.extend(Collection.prototype, {
comparator: function(places) {
return places.get('done');
}
});
return Collection;
}
};
exports.definition={
配置:{
“栏目”:{
“id”:“整数”,
“地址”:“文本”,
“用户_已完成”:“整数”
},
“适配器”:{
“类型”:“acs”,//使用“acs”
“集合名称”:“地点”
}
},
扩展模型:函数(模型){
_.扩展(模型、原型、{
验证:函数(attrs){
for(属性中的变量键){
var值=属性[键];
如果(值){
如果(键==“项目”){
如果(value.length您需要在配置中使用“acs
”
选中此项:
exports.definition = {
config: {
"columns": {
"id":"integer",
"address":"text",
"user_completed":"integer"
},
"adapter": {
"type": "acs", // Use "acs"
"collection_name": "places"
}
},
extendModel : function(Model) {
_.extend(Model.prototype, {
validate : function(attrs) {
for (var key in attrs) {
var value = attrs[key];
if (value) {
if (key === "item") {
if (value.length <= 0) {
return 'Error: No item!';
}
}
if (key === "done") {
if (value.length <= 0) {
return 'Error: No completed flag!';
}
}
}
}
}
});
return Model;
},
extendCollection : function(Collection) {
_.extend(Collection.prototype, {
comparator: function(places) {
return places.get('done');
}
});
return Collection;
}
};
exports.definition={
配置:{
“栏目”:{
“id”:“整数”,
“地址”:“文本”,
“用户_已完成”:“整数”
},
“适配器”:{
“类型”:“acs”,//使用“acs”
“集合名称”:“地点”
}
},
扩展模型:函数(模型){
_.扩展(模型、原型、{
验证:函数(attrs){
for(属性中的变量键){
var值=属性[键];
如果(值){
如果(键==“项目”){
if(value.length.thanking.ACS是新同步适配器的名称,但必须创建才能工作。我遇到了aaronksaunders提供的示例,但适配器似乎过于复杂。希望Tianium将在其下一次更新中添加ACS适配器…这对您有效吗?如果是,请接受答案:)谢谢。ACS是一个新的同步适配器的名称,但必须创建才能工作。我遇到了aaronksaunders提供的示例,但适配器似乎过于复杂。希望Tianium将在其下一次更新中添加ACS适配器…这对您有效吗?如果是,请接受答案:)