Hybrid View

  1. #1
    Sencha User
    Join Date
    May 2011
    Posts
    47
    Vote Rating
    0
    nmb1106 is on a distinguished road

      0  

    Default MessageBox not appearing until work is done on grid

    MessageBox not appearing until work is done on grid


    I'm having trouble getting any type of messagebox to appear. I have a tree grid that with this UI can contain hundreds of nodes. The current example I have is 888 total items in the grid. When the grid gets this large the collapse/expand methods can take a large amount of time during which the browser appears as it is hung.

    I have placed a collapse button on my toolbar and in the selection method did this:

    MessageBox mb = MessageBox.wait("XML Preview", "Collapsing tree", "Please wait...");
    treeGrid.collapseAll();
    mb.close();

    The messagebox is never appearing at all...to see if it was appearing and closing i deleted the mb.close line and tried it again...the MessageBox doesn't appear until after all of the collapseAll work is done.

    I thought maybe this is happening because the grid is being updated so it appears over the top of the mb. To make sure that wasn't the case I shrunk my grid window and see nothing appearing behind it.

    Any help would be appreciated. I've tried this several ways..on the before collapse/collapse grid events..beforeselect/select button events..view ready.. No luck..

  2. #2
    Sencha User
    Join Date
    Sep 2007
    Posts
    13,971
    Vote Rating
    132
    sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light

      0  

    Default


    The problem is that in your browser, everything is single threaded. You need to add some time between showing the MessageBox and collapsing your entries.
    Code:
    MessageBox mb = MessageBox.wait("XML Preview", "Collapsing tree", "Please wait...");
    Scheduler.get().scheduleDeffered(new Scheduler.Command() {
    ...
    treeGrid.collapseAll();
    mb.close();
    ..
    }

  3. #3
    Sencha User
    Join Date
    May 2011
    Posts
    47
    Vote Rating
    0
    nmb1106 is on a distinguished road

      0  

    Default


    Thank you for the response, knew it was something like that.

    Instead of the wait I'd like to do a progress bar but thats even worse..can't update the progress bar for the same exact problem..tried nesting another defer in there but didn't work ...If not this is good enough thanks a lot

  4. #4
    Sencha User
    Join Date
    Sep 2011
    Location
    Leipzig, Germany
    Posts
    75
    Vote Rating
    2
    A.Rothe is on a distinguished road

      0  

    Default


    I would add your treeGrid code into an Events.Show listener, which you could add to the MessageBox.getDialog().

    André

Thread Participants: 2