fixed extend() in sample

This commit is contained in:
Andy Gup 2015-03-04 17:57:50 -07:00
parent a27ad858e1
commit 618d2281cf

View File

@ -390,9 +390,16 @@
offlineFeaturesManager.on(offlineFeaturesManager.events.EDITS_ENQUEUED, editsEnqueued);
offlineFeaturesManager.on(offlineFeaturesManager.events.EDITS_SENT, updateStatus);
offlineFeaturesManager.on(offlineFeaturesManager.events.ALL_EDITS_SENT, allEditsSent);
offlineFeaturesManager.on(offlineFeaturesManager.events.EDITS_SENT_ERROR, editsError);
offlineFeaturesManager.extend(busStopFeatureLayer);
console.log("offlineFeaturesManager initialized.");
offlineFeaturesManager.extend(busStopFeatureLayer,function(result, error){
if(result){
console.log("offlineFeaturesManager initialized.");
}
else{
alert("Unable to initialize the database. " + error);
}
});
Offline.check();
Offline.on('up', goOnline);
@ -758,6 +765,10 @@
}
}
function editsError(){
alert("There was a problem. Not all edits were synced with the server.");
}
function updateStatus(){
if( editsStore.hasPendingEdits())
{