-
8 Dec 2011 6:52 AM #1
Ext.List shows emptyText immediatly irregardless of deferEmptyText
Ext.List shows emptyText immediatly irregardless of deferEmptyText
I have an ext.List and want to show a text when there are no items in it. According to the documentation I can use the emptyText config for that. However, I want this text to be only shown after loading data from the attached store. This should happen automatically because deferEmptyText is true by default.
However, the text is shown immediately. Is this a bug, is or is there something I am overlooking?
I am now going to try a workaround where the emptyText is set after the datachanged event, but it would be nice to know what exactly is going on here.Code:var list = Ext.create('Ext.List', { id: 'locationList', emptyText: 'No items found.', deferEmptyText: true, store: myStore });
I am using Sencha Touch 2.0.0 PR2.
Relevant API Documentation: http://docs.sencha.com/touch/2-0/#!/....dataview.List
-
8 Dec 2011 7:28 AM #2
emptyText element remains in DOM
emptyText element remains in DOM
While working on my workaround I discovered another weird behavior.
The emptyText is placed inside an element with the class x-innerhtml. It is placed there the first time an emptyText is set. However, once the list is filled with items this element remains in the DOM. If there are any styles attached to it it will be visible on top of the list.
The workaround for this is to place another element inside the emptyText and apply the styling there.
This is the code that works:
HTML Code:myStore = Ext.create('Ext.data.JsonStore', { model: 'myModel', storeId: 'myStore', listeners: { datachanged: function() { myList.setEmptyText('<div id="noItemsMessage">No items found.</div>'); } });
-
8 Dec 2011 3:39 PM #3
Thanks for the report. We shall look into it.
Sencha Inc.
Robert Dougan - @rdougan
Sencha Touch 2 and Ext JS 4 Core Team Member, SASS/Theming Wizard.
Success! Looks like we've fixed this one. According to our records the fix was applied for
TOUCH-1203
in
2.0.


Reply With Quote