Database 从模型、sql数据库中提取信息,并将其保存到变量中
所以我有这个功能,当点击它时,它会将信息保存到数据库中,或者模型不确定差异是什么。我希望以后能够从模型中获得“Num_of_elements”的值,我将如何处理这个问题。model.execute(sql查询)?如果您有票据编号,您可以使用主干收款功能执行此操作:Database 从模型、sql数据库中提取信息,并将其保存到变量中,database,mobile,titanium,models,Database,Mobile,Titanium,Models,所以我有这个功能,当点击它时,它会将信息保存到数据库中,或者模型不确定差异是什么。我希望以后能够从模型中获得“Num_of_elements”的值,我将如何处理这个问题。model.execute(sql查询)?如果您有票据编号,您可以使用主干收款功能执行此操作: var manifest = Alloy.Collections.manifest; function submit(){ list_view.open(); manifest.fetch();
var manifest = Alloy.Collections.manifest;
function submit(){
list_view.open();
manifest.fetch();
var model = Alloy.createModel('manifest', {
bill: //(need to be an incremented value),
Num_of_elements: $.items.value
});
manifest.add(model);
model.save();
}
var manifest = Alloy.Collections.manifest;
var manifest = manifest.where({
bill : // your bill number
})[0]; // Get the first one returned