Question

I have a sencha app and launch in Android with phonegap. In my controller config.js I do window.open() when the user push a button and I add the Event Listener for 'loadstop' but I don't receive the event never.

onDeviceReady: function(){
  var manual = window.open('resources/manual/manual.html', '_blank', 'location=no');
  manual.addEventListener('loadstop', function() { alert('start'); });
},

goToManual: function () {
  document.addEventListener("deviceready", this.onDeviceReady, false);
}

thanks for the help and sorry for my English

Was it helpful?

Solution

I guess that you are using the default JS method window.open. Since sencha mixes up things in that case, I don't think you can add listeners or make changes if you are working on a mobile device.

So use this instead to make sure your call uses Cordova plugin:

var manual = null;
Cordova.exec(manual = window.open('resources/manual/manual.html', '_blank', 'location=no'));

The app crashes for me a few seconds after opening the page though.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top