PDA

View Full Version : Ext.grid.Panel - emptyText when store is empty



Ayashi
5 Jun 2012, 1:06 AM
Aloha,

I'm wondering why the 'emptyText' option is ignored when the grid is drawn and the store still empty.

I have an empty store that is binded to the grid and when the page is rendered the 'emptyText' parameter isn't applied. If I add an item and remove it, the text is displayed. If I reorder the columns (store still empty), the test is displayed.

When the control is drawn :

35955

When I click on the column header :

35956

Any help?

Kind regards,
Aya.

carol.ext
5 Jun 2012, 1:30 PM
Did you try setting deferEmptyText (http://docs.sencha.com/ext-js/4-1/#!/api/Ext.grid.View-cfg-deferEmptyText) to false? By default it is true.

As I recall, that worked in previous versions. I haven't tried it in 4.x.

Ayashi
5 Jun 2012, 11:50 PM
Thank you for your answer, I've tried to use the deferEmptyText (http://docs.sencha.com/ext-js/4-1/#!/api/Ext.grid.View-cfg-deferEmptyText) but it has no effect on the rendering. (even if it looks to be the correct solution).

The only way I've found was to force a re-order of the data in the grid when the control is created :


MatchedOIDstore.sort('OID', 'DESC');

..but.. when the grid is inside a tabpanel that is not the active one, this action has no effect. I had to add a listener on the tabpanel to catch the tab change event :


listeners: { tabchange: function() { sortStores(); }}

Thank you!
Aya.