Search code examples
extjsextjs4

Pop up message in case of an empty panel grid EXTJS


Hi :) I want to display a popup with a message in the case of a panel grid displayed empty. i've found some think like

 viewConfig: {
        stripeRows: true,
        deferEmptyText: false,
        emptyText: 'No data Available'
    },  

but the message is displayed inside the grid, my need is to disply this message in a popup view. Any leads ? thanks in advance :)


Solution

  • Your grid has a store, and that store has a load event. Attach an event listener for that event, and check for the number of rows. If zero, use the Ext.MessageBox class (e.g the alert method) to pop up the message.