Control Auto-Synchronization During Mobile App Startup
Mobile Framework
Control Auto-Synchronization During Mobile App Startup
Background data tables are read-only tables that contain data for tables such as buildings, floors, rooms, division and department.
The framework contains the
autoBackgroundDataSync
property. Setting this property to
true
will cause the background data to be synced when the app is started.
The
autoBackgroundDataSync
property is set in the
Ext.application
configuration.
Example – Enable background sync on Application Start
Ext.require([ 'Common.scripts.ApplicationLoader', 'Common.Application', 'Ext.data.Validations','Common.lang.LocaleManager' ], function() {
Ext.application({
name : 'AssetAndEquipmentSurvey',
autoBackgroundDataSync: true,
….
});
});
A custom sync function can be supplied using the
backgroundSyncFn
property. The function supplied to this property will be executed when the app starts.
Example – Supply Custom Sync Function
Ext.require([ 'Common.scripts.ApplicationLoader', 'Common.Application', 'Ext.data.Validations','Common.lang.LocaleManager' ], function() {
Ext.application({
name : 'AssetAndEquipmentSurvey',
autoBackgroundDataSync: true,
backgroundSyncFn: function(onCompleted, scope) {
var me = this;
syncController = me.getController('AssetAndEquipmentSurveySync');
syncController.doAutoBackgroundSync(onCompleted, scope);
…
}
});
});