Ext.define('TradePortal.store.StatementsDrillDownEmail', {
    extend: 'Ext.data.Store',
    model: 'TradePortal.model.Valid',
    storeId: 'StatementsDrillDownEmail',
    proxy: {
        type: 'jsonajax',
        url: BASE_URL + '/fluid/FluidAppServerProxy?ipApi=presenter&ipService=Frameworks.Interfaces.Mobile.TradePortal&ipFunction=emailStatement'
    },
    listeners: {
        load: {
            fn: function (store, records, options) {
                if (!records[0].data.errorTable) {
                    Ext.getCmp('statements_drilldown_email').close();
                } else {
                    Ext.Msg.alert('Alert', records[0].data.errorTable[0].msg,
                        Ext.emptyFn);
                }

                Ext.getCmp('statements_drilldown_email').setLoading(false);
            }
        }
    }
});
