I’m using Phonegap 2.2 and Sencha Touch 2.0.
I’d like to call Sencha Touch specific function from within a Phonegap pause event, code like so:
document.addEventListener("pause", onPause, false);
function onPause() {
//sencha function here, get Ext.Viewport.getItems()
}
This currently doesn’t work, as it thinks Ext is undefined. How do I get a reference to my Ext application so I can manipulate my Sencha code through Phonegap?
It’s likely that you have not initialized Sencha Touch before the device ready function has been called. Ext.Viewport will work as long as Sencha Touch has been initialized.