PDA

View Full Version : Collapse/minimize the Grid if the grid contains no data



ravimaroju
23 Jan 2013, 5:38 AM
Hi

I have an requirement that , i want to display an Alert box ("No Records") & collapse/minimize the Grid if the Grid contains No data..


Actually we are able to display the Error message inside the grid view by placing the following code:

viewConfig: {
emptyText: 'No Records'
}

But i don't want to display the Empty Grid ..:((

Any Help Would be Appreciated..=D>

Thanks in Advance..

Farish
23 Jan 2013, 7:10 AM
you could hide the grid or show it on the load event of the grid's store:


store.on('load', function() {
if(store.getRange().length > 0)
grid.show();
else
grid.hide();
});

OR you may set collapsible: true on the grid and then call grid.collapse() and grid.expand() instead of the hide and show methods respectively.

ravimaroju
23 Jan 2013, 9:05 PM
Kudos Farish,,,

Every thing Working good,,

It Was Great Work. =D>

Thanks