Results 1 to 5 of 5

Thread: "alert()" interrupts function

  1. #1

    Default "alert()" interrupts function

    I had real problems to get my code working- now I've realised that if i eliminate all alerts in my code everything works fine?
    any ideas?
    this is my code:

    function deleteMessage(){
    var param=grid.getSelectedRowId();
    alert('test');
    dialog('delete',param); //function defined in another skript
    }

    var tb = new YAHOO.ext.Toolbar('example-toolbar');
    tb.addButton({
    text: 'delete',
    click: deleteMessage
    });

    the alert works fine - but the code after the alert is never reached.
    As soon as I remove the alert the function dialog() is reached and works fine.
    thanks for help!

  2. #2
    Sencha User Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Nottingham
    Posts
    30,892

    Default

    How do you know it's not executing the following lines? Have you stepped through it in Firebug?

  3. #3
    Ext User
    Join Date
    Mar 2007
    Posts
    176

    Default

    the alert function pauses the code...it won't continue until you click ok.

    if you want to alert yourself when an event has happened without pausing the code, don't use alert and change the the background-color of an element instead, which you can do with Jack's Element.setStyle...or try anything else that's visual (change text, move an element, etc.)

    hope that helps.

  4. #4
    Sencha User Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Nottingham
    Posts
    30,892

    Default

    Best thing is to log messages to Firebug's console.

    Code:
    YAHOO.widget.Logger.enableBrowserConsole();
    
    ....
    
    YAHOO.log("test");

  5. #5
    Ext User
    Join Date
    Mar 2007
    Posts
    176

    Default

    true story...

Similar Threads

  1. Where are animate classes: "Actor" , "Animato
    By Young in forum Ext 2.x: Help & Discussion
    Replies: 13
    Last Post: 25 Jul 2007, 4:00 AM
  2. "FireFox2 kills cursor" and text-select in toolbar
    By brian in forum Ext 1.x: Bugs
    Replies: 8
    Last Post: 7 Jun 2007, 12:12 AM
  3. Show "Loading" message before load a Grid
    By cadudecastroalves in forum Ext 1.x: Help & Discussion
    Replies: 1
    Last Post: 11 Dec 2006, 6:43 AM
  4. Replies: 13
    Last Post: 9 Dec 2006, 12:28 PM
  5. In Grids, does not work function "focusRow" :(
    By lbpf in forum Ext 1.x: Help & Discussion
    Replies: 6
    Last Post: 29 Nov 2006, 6:39 AM

Posting Permissions

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