Forum /
Ext JS 2.x - Unsupported /
Ext 2.x: Help & Discussion /
E.fireFn.apply is not a function
E.fireFn.apply is not a function
Hi
I have a message box set on the onReady state of a form - the prompt comes up ok but I get the above error in FF - can anyone help
<script type='text/javascript'>
Ext.onReady(
Ext.MessageBox.show({
title:'System Message',
msg: 'Blah blah, blah',
buttons: Ext.MessageBox.OK,
fn: showResult,
icon: Ext.MessageBox.QUESTION
}))();
function showResult (btn) {
if (btn=='ok') {window.close();}
}
</script>
Thanks
Sencha - Ext JS Dev Team
Ext.onReady must be passed a function reference.
What you are passing there, if you read your code, is the result from Ext.MessageBox.show
Yes - when the page loads, a prompt box comes up then they press ok and the window closes
Sencha - Ext JS Dev Team
Yes, and the result from that call is passed into Ext.onReady which if you read its docs, expects to be passed a reference to a function which it executes when the DOM is ready.
It attempts to make a call to whatever the return value of Ext.MessageBox.show() is!
Sorry you have lost me !!!
Sencha - Ext JS Dev Team
OK.
Ext.onReady accepts a function as it's parameter.
It will call this function when the DOM is ready.
Clear so far?
I think so - isn't this is what it is doing already?? Ext.onReady(......
Sencha - Ext JS Dev Team
OK, you realize you need to pass a function object into Ext.onReady?
yes
so i am back to square one - the function is being passed yet i still get the error message
Am i missing something ?
Sencha - Ext JS Dev Team
Stop running ahead.
You are NOT passing a function.
You are passing the return value from a call to Ext.MessageBox.show!
Sencha is used by over two million developers. Join the community, wherever you’d like that community to be
or Join Us