View Full Version : show message when store for List View is empty ~~

5 Sep 2011, 11:12 PM
I am loading a store from ajax call which returns Json. I want to show a message of type - "No data found" when the store is empty. This store is being loaded in a List which is an item of a Panel.
How to do that, please help!!

var storeLeavesApp = new Ext.data.Store({
model: 'Leaves',
autoLoad: true,
proxy: {
url : LX.Ajax.pageMethodURL('getAppLeaves'),
type: 'ajax',
type: 'json'

var list1 = new Ext.List(Ext.apply(groupingBase, {
store: storeLeavesApp,
itemTpl: '<div style="font-size:11px;font-weight:bold;font-color:blue;">{name}<span style="float:right;font-size:11px;">{title}&nbsp;- {duration}&nbsp;</span></br><span style = "font-color:blue;">#{Empid}</span><span style="float:right;font-size:11px;">{fromDate}&nbsp;to&nbsp;{toDate}</span></div>'

Any help is appreciated !!

6 Sep 2011, 10:50 AM
The list has an emptyText property. fill that with whatever you wanted shown when list is empty.

Hope that helps