Results 1 to 2 of 2

Thread: Show wait dialog message while looping through an array that's hiding grid columns

  1. #1
    Sencha User
    Join Date
    Mar 2011
    Posts
    24

    Default Show wait dialog message while looping through an array that's hiding grid columns

    I'm adding a button that hides a lot of grid columns this takes about 5-10 secs depending on how much data is in the grid. I want to show a wait dialog message so the user knows that something is happening. I would like to show the message then wait for the array to finish then hide the message, something like in the code below. This doesn't work it shows the message after the array finshes then its removed straight away. Any ideas of how to achieve this?
    Code:
    {  
      xtype: 'button', 
      text: 'Budgets Only',
      handler: function() {
       var grid = this.up('budgetwatchesgrid');
       var columns = grid.columns;
    
       Ext.MessageBox.show({
           msg: 'Removing columns, please wait...',
           progressText: 'Removing...',
           width:300,
           wait:true,
           waitConfig: {interval:200}
          });   
           
       Ext.Array.each(columns, function(item, index, countriesItSelf) {
       if (Ext.util.Format.substr(item.name, 0, 6) != 'BUDGET' && index > 1) {
        grid.columns[index].hide();
        }
       });
       Ext.MessageBox.hide();
       }
      }

  2. #2
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,449

    Default

    It takes a bit of time for the MessageBox to show and sounds like it is happening after the columns loop is happening. Try deferring the Ext.Array.each and the hide() call
    Mitchell Simoens @LikelyMitch
    Modus Create, Senior Fullstack Engineer
    ________________
    Modus Create is based on the model of an open source team. We’re a remote, global team of experts in our field. To find out more about the work we do, head over to our website.

    Check out my GitHub:
    https://github.com/mitchellsimoens

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
  •