Hybrid View
-
5 Feb 2008 3:45 AM #1
[HELP] Understanding createCallback
[HELP] Understanding createCallback
I'm trying to get my head around createCallback but i'm getting a bit confused with it, i've assumed that it is possible to use createCallback to apply a callback to ANY function you create?
So the following is how i think it works?
Am i correct? or way off the mark?!Code:function shout(msg){ Ext.Msg.alert('ALERT!', msg); } function run(){ ds.load(); ds.on('load', function(){ds.getAt(0)}) } run().createCallback(shout('I wish i understood this'))
-
5 Feb 2008 3:48 AM #2Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- The Netherlands
- Posts
- 24,251
- Vote Rating
- 40
Try:
Code:function shout(msg){ Ext.Msg.alert('ALERT!', msg); } function run(fn){ ds.on('load', fn, null, {single:true}); ds.load(); } run(shout.createCallback('I wish i understood this'));


Reply With Quote