mardi 20 janvier 2015

The grid View does not always refresh when store is filtered to empty

Hi, not sure if this is a bug or not but consider the following (Ext is 5.1.0):

You have a grid created with an id: 'testGrid' and some records in the store.

The Grid's view is also configured with an emptyText set to some string (and deferEmptyText: false)


I have a fiddle here:


Now, open the console and execute (may be you should open the fiddle in a new tab, it is here: http://ift.tt/1Cx12os):



Code:



Ext.getCmp('testGrid').getStore().getFilters().add( new Ext.util.Filter({ property: 'name', value: 'none' }) )

What you will see is that the grid panel is cleared, but the emptyText will NOT be displayed .

Now, execute:



Code:



Ext.getCmp('testGrid').getView().refresh()

and the emptyText will be shown

OR

execute the first code snippet again and the emptyText will also be shown ??

Got to this when playing around with the updated 5.x.x UX SearchField, which is using store filtering.


Any idea why this happens?

I understand that the store itself has nothing to do with the View's behavior, so may be the problem is within the View itself (it does not execute it's refresh() method properly when a filter is applied to the store - but in other hand, the records are removed and only the emptyText is skipped???)






The grid View does not always refresh when store is filtered to empty

Aucun commentaire:

Enregistrer un commentaire