The JayData team always focused to online-offline application as this requirement that arises very often in HTML5 applications regardless if we are talking about a mobile PhoneGap/Cordova app or a web application.
To make the sync of changed entities easy, we added an overload to the context.YourEntitySet.attach(yourEntityInstance) function to let you configure the change-tracking behavior of JayData.
The attach acceps EntityAttachModes in the second parameter, such as:
- $data.EntityAttachMode.AllChanged – sets all fields to changed status and makes JayData to update all fields in the sync target storage
- $data.EntityAttachMode.KeepChanges – keeps the changed fields that were modified before the attach()
- $data.EntityAttachMode.Default – resets the modified fields and tracks changes that are will be changed after attach()
… To be continued…