Hi all, in alloy framework, model created as follows : exports.definition = { config: { columns: { "date": "text", "project_id": "INTEGER", "desc": "text",... adapter: { type: "sql", db_name: 'Calender', collection_name: "Calender" }
UPDATE Operation:
updateDetailsbyId : function (tmp_prj) {
var collection = Alloy.createCollection('Calender');
var model = Alloy.createModel('Calender',{
date : tmp_prj.date,
project_id : tmp_prj.project_id,
desc : tmp_prj.desc,
...
});
collection.add(model);
model.save();
NOTE: there is no PRIMARY Key exists in this model, causes db to create one more row, instead of updating in existing row,
can it be acheived without primary key or is there any alternative to this????? (similar problem with removing particular row as well.)
further details : Application type:: mobile sdk :3.3.1 G.A., O.S. : mac 10.8.2 platform : issue is independent of platform version, as of now using iphone xcode verison : 4.6.3.