Results 1 to 2 of 2

Thread: Loading... flashes when store is reloading

  1. #1
    Sencha User
    Join Date
    Aug 2013
    Posts
    3
    Answers
    1

    Default Answered: Loading... flashes when store is reloading

    I have a basic grid, and store. To get the grid auto refresh I used the apparently often recommended approach of TaskRunner and reload() (see below). I am not very happy with the result!

    When the reload starts, user gets "Loading..." and the animated thingy on gray background at the grid. When the reload is ready, the grid returns to previous state. This flashing of loading placeholder is a bit bummer. I had expected something like "load the data in background, compare the sets of data for changes, and change the data record by record in store/grid", without graphical glitches. Are there any solutions for getting nicer behavior?

    Code:
    Ext.define('APP.store.Potatos', {
        extend: 'Ext.data.Store',
        model: 'APP.model.Potato',
        autoLoad: false,
        proxy: {
            type: 'rest',
            url: '/api/potatos',
            reader: {
                type: 'json',
                root: 'potatos',
                successProperty: 'success'
            }
        },
        constructor: function() {
    
    
            this.callParent(arguments);
    
    
            // Start automatic refresh
            var runner = new Ext.util.TaskRunner();
            var me = this;
            var task = runner.start({
                run: function() {
                    if (me.getCount()>0) { // The store might not be ready in my case, just a simple check
                        console.log('have to reload now!');
                        me.reload();  // Nasty loader screen flashes
                    }
                    
                },
                interval: 3000 // For testing
            });
        }
    });

  2. Adding

    Code:
    viewConfig: {
      loadMask: false
    }
    improves the situation drastically. Also adding

    Code:
    invalidateScrollerOnRefresh: false
    fixes scrolling status get reset.

    Anything else I should be aware of?

  3. #2
    Sencha User
    Join Date
    Aug 2013
    Posts
    3
    Answers
    1

    Default The view settings

    Adding

    Code:
    viewConfig: {
      loadMask: false
    }
    improves the situation drastically. Also adding

    Code:
    invalidateScrollerOnRefresh: false
    fixes scrolling status get reset.

    Anything else I should be aware of?

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
  •