Harasunu V N
Harasunu V N

Reputation: 41

Extjs Gridpanel buffered renderer scroll not reseting

I have been trying to implement a buffered grid panel using the buffered store and "bufferedrenderer" plugin with ExtJs 5.1.1. When I load lesser content than the previously loaded content, the scroll is not reseting. I still have to scroll long way down to find my content on the panel. The height of the content area remains as the previous content's height. It would be really grateful if somebody can give me a suggestion.

Thank you in advance.

Upvotes: 2

Views: 639

Answers (1)

Lucian Depold
Lucian Depold

Reputation: 2017

We experienced the same when switching from a grid with many elements (+ some scrolling done ) to the same grid with no element. We solved this by overriding Ext.data.Store to throw a clear event when clearData() is called. The clear event triggers a call to onStoreClear() of Ext.grid.plugin.BufferedRenderer. This solved the problem for us.

Ext.define('Ext.data.Store', {
    override: 'Ext.data.Store',

    config: {
        forceClearEventOnLoad: false
    },

clearData: function(isLoad, data) {
    if(this.forceClearEventOnLoad && isLoad) {
        this.fireEvent('clear', this, data);
    }
    this.callParent(arguments);
}

});

Dont forget to set forceClearEventOnLoad:true in your store config.

Upvotes: 1

Related Questions