I am trying to write a simple CRUD function in Jaydata, I wrote this simple code for the update operation:
SampleClass.prototype.Load = function(input1,callback) { var param='it.Name=="'+input1+'"'; this.data.items.filter(param).forEach(function(ii) { callback(ii); }); this.data.items.saveChanges(); };
so when i call:
t.Load('Entry4',function(res){console.log(res.Name)})
It works like a charm! But if I call the update operation for the callback, for example:
t.Load('Entry4',function(res){res.Name="Entry5"})
This does not change anything in the database. I saw something like the beginTransaction function, as in http://jaydata.org/examples/JayDataPro/ToDoList_complex , but I could not understand its essence.
source share