Results 1 to 4 of 4

Thread: Ext.Msg not understanding Y its happening

  1. #1
    Sencha User poojagarg89's Avatar
    Join Date
    Sep 2011
    Location
    Ahmedabad,India
    Posts
    213

    Default Ext.Msg not understanding Y its happening

    I have a Code for Button :

    Code:
    buttons:[{
                     text:"Click Me!!",
                     iconCls:'',
                     width: 100,
                     listeners:{
                         click: function(){
    //                         Ext.Msg.alert("Delay By 5sec.",5000);
                             setTimeout(function(){
                             Ext.Msg.alert('Done', 'data saved!');
                    }, 5000);
                         }
                     },
                     handler: function(){
                        Ext.Msg.alert("Its Me");
                     }
    }]

    Here I have an alert msg in handler n one on click event in listeners...................
    now what is happening that I have given 5000(5sec) delay to listeners msg....................

    If I dont use the delay only handler msg shows up and listeners msg wont b coming But when I use delay tym..............It gives alert msg of handler first and then after 5secs it gives the listeners msg

    Just want to know Y is this happening with n without delay timeout....................


    Can someone provide me with an xplanation?

    Thanks,
    Pooja

  2. #2
    Sencha User
    Join Date
    Jan 2011
    Posts
    549

    Default

    I don't understand why you would use both the listener AND the handler?

    Surely they're pretty much the same event, therefore just use one?

  3. #3
    Sencha User poojagarg89's Avatar
    Join Date
    Sep 2011
    Location
    Ahmedabad,India
    Posts
    213

    Default

    Ya m not using both I was just experimenting n was thinking Y they r showing such behavior so just wanna know about it.................

  4. #4
    Sencha User
    Join Date
    Jan 2011
    Posts
    549

    Default

    If you're not using both, then can you clarify what code you are using, and what the issue actually is (i.e. what are you expecting compared to what is actually happening)?

    It also looks like you're using Ext messageboxes for your debugging needs, which is probably serious overkill. I would honestly recommend you just use console.log for such things as notifying you which section of code has been run.

    e.g.
    console.log('Handler Logic')

Posting Permissions

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