PDA

View Full Version : if no data in Ext.data.Store



coooolmagic
22 Jul 2010, 5:14 AM
HI all

I am trying to build a grid and defined data store for grid.
There are several cases where this data store will be empty.

How can i specify some default message if there is no data in data store? so i don't get any java script error

my store:
data: arydata is dynamic JSP array.

var store = new Ext.data.Store({
reader: reader,
autoLoad: true,
data: arydata,
sortInfo:{field: 'document_name', direction: "ASC"}

});

Condor
22 Jul 2010, 5:34 AM
In the grid:

viewConfig: {
deferEmptyText: false, // <- because your store is already loaded
emptyText: 'No records'
}

coooolmagic
22 Jul 2010, 5:47 AM
fantastic! thanks