Extjs load mask

I have a grid that, when clicked, takes a few seconds to pop up the popup. I want the message "Loading ..." to be displayed while the popup is loading. This is what I have so far:

    onCellClick : function(view, td, eOpts ) {
    var myMask = new Ext.LoadMask(Ext.getBody(), {msg:"Please wait..."});
    myMask.show();
    Ext.create('myapp.view.DetailWindow', {
        title : 'my title',
        width : 900,
        approachRec : record
    });
    myMask.hide();

}

      

Now this works great, as soon as I click on a cell in the grid, the loading window appears, after which the "DetailWindow" appears.

However, as soon as I close my window and click on another cell (or the same one) again. The download window does not appear, but my detail window does. What am I doing wrong?

What do I need to do to make the loading box appear every time I click on a cell?

I am using Extjs 4.2

Thank,

+3


source to share


1 answer


The code you posted doesn't show () the window, it just creates it. Below is some code I developed that "works" (I used setTimeout to display the window after a 3 second delay and then hide the loading mask), but I think that in order to understand the problem, you have to use your debugger and see if any errors are displayed in the console.



grid.on('cellclick', function() {
    var myMask = new Ext.LoadMask(Ext.getBody(), {msg:"Please wait..."});
    myMask.show();
    var window = Ext.create('Ext.window.Window', {
        title: 'Hello',
        height: 200,
        width: 400
    });
    setTimeout(function() {
        window.show();
        myMask.hide();
    }, 3000);
});

      

+3


source







All Articles