Ext.define('TradePortal.store.copyTranToCart', {
    extend: 'Ext.data.Store',
    model: 'TradePortal.model.Valid',
    storeId: 'copyTranToCart',
    proxy: {
        type: 'jsonajax',
        url: BASE_URL + '/fluid/FluidAppServerProxy?ipApi=presenter&ipService=Frameworks.Interfaces.Mobile.TradePortal&ipFunction=copyTranToCart'
    },
    listeners: {
        load: {
            fn: function (store, records, options) {
                Ext.getCmp('main_panel').items.items[1].down('panel').items.each(function (panel) {
                    panel.hide();
                });
                Ext.getCmp('products_panel').show();
                Ext.getStore('Cart').load({
                    params: {
                        userName: Ext.getStore('HomeStatistic').last().data.id_user,
                        sessionID: Ext.getStore('createCart').last().data.sessionID
                    }
                });
            }
        }
    }
});
