Hi I am working on offline viewing functionality using Webviewer 7, but I got stuck in some issues.
First one to check if document is already in IndexedDB, I use doc.initOfflineDB(); doc.isDownloaded() but it seems to always return false.
Second one is the function setOfflineModeEnabled(true); throws this error:
Uncaught TypeError: Cannot read property ‘ZO’ of undefined
at ua.sp (CoreControls.js:44)
at aa.sp (CoreControls.js:11)
at config_horizon.js?q=78784545814:168
at wn (webviewer-ui.min.js:58)
at webviewer-ui.min.js:239
at hl (webviewer-ui.min.js:34)
at Es (webviewer-ui.min.js:34)
at webviewer-ui.min.js:42
at Go (webviewer-ui.min.js:34)
at Ss (webviewer-ui.min.js:34)
Thanks for your reply. I am using this code snippet to determine whether the document is downloaded in browser’s IndexedDB, I send the document id to the function, but it seems to always to return false.
function checkDownloaded(id) {
var doc = new CoreControls.Document(id,‘xod’);
doc.initOfflineDB().then(function(){
console.log(doc.isDownloaded());
return (doc.isDownloaded());
});
}
I am passing the correct id of the document. Can you please help me out if I am doing something wrong at my end?