0
votes

Whats the smartest way to add a ajax loader gif image in the center of screen every time my Sencha 2 app does a ajax request? Should be some kind of code snippet which should check if a internal Javascript counter which keeps track of all open Ajax requests is > than 0 and thereby show the loader gif

1

1 Answers

1
votes

Normally I just put the code below before a ajax request.

Ext.Viewport.add({
    masked: {
        xtype: 'loadmask',
        message: 'A message..',
        indicator: false
    }
});

You might want to extend the ajax class and add it there to get this to work for every ajax request.