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

Thread: Change message of a mask after its showing - may be progressbar

  1. #1

    Default Change message of a mask after its showing - may be progressbar

    Hi everyone

    I want to change message of a mask after its showing. For example we show progress bar in flash to display percentage of loading.

    I tried progress bar but its not updating its progresstext (i dont know why!!!)

    Code:
    Create:
    var mask = Ext.Msg.progress("Importing Text", "Processing...", "Please wait...");
    
    Update:
    mask.updateProgress(number, text, "Processing...");
    
    Close/hide:
    mask.hide();
    But if i use console.log() in method where mask.updateProgress is used, i get correct output....
    What am I doing wrong????

    Thanks alot for help
    Regards

  2. #2

    Default

    hi everyone...

    Any example that shows how to use progressbar...

    I got this one but it has timeout....i dont want to set any timeout coz already my function takes alot time

    http://www.java2s.com/Code/JavaScrip...sBardialog.htm

    Please help me...
    Regards

  3. #3

    Default

    There is no way to do this???? I just dont want to use timeout as already my function takes alot of time (offcourse only in some cases).....

    Please help me..
    Regards

  4. #4
    Sencha User Screamy's Avatar
    Join Date
    Jun 2008
    Posts
    244

    Default

    This always works for me:

    Code:
    Ext.Msg.progress('Please wait', 'Updating Something', '...working...');
    
    // after 10% of the work is done.
    Ext.Msg.updateProgress(.1, '...working...', 'Updating Something: 10%' );
    
    // after 20% done.
    Ext.Msg.updateProgress(.2, '...working...', 'Updating Something: 20%' );
    
    // etc.
    Ext.Msg.updateProgress(.3, '...working...', 'Updating Something: 30%' );
    You could also try the 'indeterminate' style progress bar:

    Code:
    Ext.Msg.wait('Updating Something', 'Please wait')
    then hide() when done.

  5. #5
    Ext User matt617's Avatar
    Join Date
    Apr 2008
    Location
    Washington, DC
    Posts
    32

    Default

    what does firebug say when you try updateProgress? always worked for me...

  6. #6

    Default

    Hi thanks for replying....

    When i use console.log() before updateProgress method.......everything works fine. Means progress bar updates as it should....but if i comment console.log() then it doesn't show the updated message in progress bar...(only in firefox)

    What could be the problem???

    Regards

  7. #7
    Sencha User Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,245

    Default

    So this is an IE issue? Do you have a long running process where you are updating the progress in between?

    That long process thread is locking up the browser. Progress changes are only visible after the thread ends.

    The only solution I know is to interrupt processing with a small setTimeout.

  8. #8

    Default

    Hi Condor thanks for replying...

    Its not an IE issue. But i guess you are correct as my process could be locking up the browser.

    Could u give an example on how to implement timeout in such a way. I already tried using setTimeout at various places but that also didn't help.... If you could explain a bit that would be really helpful.

    My code is something like this...
    Code:
    mask.show();
    
    for(var i=0; i<50; i++){
    					
    	//console.log("i = " + i);
            mask.updateProgress(i / 50, (i+1) + " of 50", "Processing...");					
            function_a(i);  // This function might be locking the browser	
    }
    
    mask.hide();
    Regards

  9. #9
    Ext User matt617's Avatar
    Join Date
    Apr 2008
    Location
    Washington, DC
    Posts
    32

    Default

    i do not think a for loop is really what you want to do. i am not a code execution expert but i am pretty sure for loops execute synchronously, so basically you wont see 1-49 youll only see 50 and it will move on right?

    whenever i have done progress updates it has been based on a task runner on a CometD push of an update, never a synchronous loop

  10. #10
    Sencha User Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,245

    Default

    Something like:
    Code:
    mask.show();
    var i = 0;
    function call_function_a() {
      mask.updateProgress(i / 50, (i+1) + " of 50", "Processing...")
      function_a(i);
      i++;
      if (i < 50) {
        setTimeout(1, call_function_a);
      } else {
        mask.hide();
      }
    }
    call_function_a();

Page 1 of 2 12 LastLast

Similar Threads

  1. Style for mask message?
    By gelgey in forum Ext GWT: Help & Discussion (1.x)
    Replies: 5
    Last Post: 14 Dec 2010, 7:32 PM
  2. Replies: 2
    Last Post: 6 Apr 2010, 3:14 PM
  3. Pointer cursor for all of mask area, not just mask message?
    By dbassett74 in forum Ext 3.x: Help & Discussion
    Replies: 0
    Last Post: 10 Jul 2009, 10:03 AM
  4. showing dynamic message in message box
    By misra123 in forum Ext 2.x: Help & Discussion
    Replies: 4
    Last Post: 23 Aug 2008, 4:36 AM

Tags for this Thread

Posting Permissions

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