Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: E.fireFn.apply is not a function

  1. #1
    Ext User
    Join Date
    Apr 2007
    Posts
    189
    Vote Rating
    0
      0  

    Default 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

  2. #2
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Redwood City
    Posts
    30,626
    Vote Rating
    56
      0  

    Default

    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
    Longtime Sencha geek. Outspoken advocate of pure Javascript Views. Posts my own opinions.

  3. #3
    Ext User
    Join Date
    Apr 2007
    Posts
    189
    Vote Rating
    0
      0  

    Default

    Yes - when the page loads, a prompt box comes up then they press ok and the window closes

  4. #4
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Redwood City
    Posts
    30,626
    Vote Rating
    56
      0  

    Default

    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!
    Longtime Sencha geek. Outspoken advocate of pure Javascript Views. Posts my own opinions.

  5. #5
    Ext User
    Join Date
    Apr 2007
    Posts
    189
    Vote Rating
    0
      0  

    Default

    Sorry you have lost me !!!

  6. #6
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Redwood City
    Posts
    30,626
    Vote Rating
    56
      0  

    Default

    OK.

    Ext.onReady accepts a function as it's parameter.

    It will call this function when the DOM is ready.

    Clear so far?
    Longtime Sencha geek. Outspoken advocate of pure Javascript Views. Posts my own opinions.

  7. #7
    Ext User
    Join Date
    Apr 2007
    Posts
    189
    Vote Rating
    0
      0  

    Default

    I think so - isn't this is what it is doing already?? Ext.onReady(......

  8. #8
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Redwood City
    Posts
    30,626
    Vote Rating
    56
      0  

    Default

    OK, you realize you need to pass a function object into Ext.onReady?
    Longtime Sencha geek. Outspoken advocate of pure Javascript Views. Posts my own opinions.

  9. #9
    Ext User
    Join Date
    Apr 2007
    Posts
    189
    Vote Rating
    0
      0  

    Default

    yes
    so i am back to square one - the function is being passed yet i still get the error message

    Am i missing something ?

  10. #10
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Redwood City
    Posts
    30,626
    Vote Rating
    56
      0  

    Default

    Stop running ahead.

    You are NOT passing a function.

    You are passing the return value from a call to Ext.MessageBox.show!
    Longtime Sencha geek. Outspoken advocate of pure Javascript Views. Posts my own opinions.

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •