I have a ExtJS 4.2.1 Controller where I fires a function after 1 second using setTimeout:
onPrint: function () {
var me = this;
// start some stuff here...
// end some stuff here...
// wait 1 second and call checkDownloadComplete function
setTimeout(me.checkDownloadComplete, 1000);
},
checkDownloadComplete: function () {
var me = this;
// validate stuff here...
if (something == "true") {
return;
}
// first approach but didn't work (maybe because the scope)
setTimeout(me.checkDownloadComplete, 1000);
// sencond approach but didn't work
Ext.bind(function () {
setTimeout(checkDownloadComplete, 1000)
}, me)
},
My first try was to use:
setTimeout(me.checkDownloadComplete,1000);But this didn't work
My second try was to comment the last line, and use Ext.bind:
Ext.bind(funciton(){setTimeout(checkDownloadComplete,1000)},me);
Any clue what I'm doing wrong? Because none of those work to call again a function it self.
Thanks
UPDATE:
I also try this but without success:
setTimeout(Ext.bind(checkDownloadComplete,me), 1000);