Ext.define('TradePortal.store.deleteMobileUser', {
    extend: 'Ext.data.Store',
    model: 'TradePortal.model.Valid',
    storeId: 'deleteMobileUser',
    proxy: {
        type: 'jsonajax',
        url: BASE_URL + '/fluid/FluidAppServerProxy?ipApi=presenter&ipService=Frameworks.Interfaces.Mobile.TradePortal&ipFunction=deleteMobileUser'
    },
    listeners: {
        load: {
            fn: function (store, records, options) {
                Ext.getCmp('viewport').setLoading(false);

                if (!records[0].data.errorTable) {
                    Ext.getStore('getListMobileUsers').load({
                        params: {
                            deviceID: Ext.getStore('Config').data.last().data.device_id,
                            customerID: Ext.getStore('HomeStatistic').data.items[0].data.id_cust
                        }
                    });
                } else {
                    Ext.Msg.alert('Alert', records[0].data.errorTable[0].msg, Ext.emptyFn);
                }
            }
        }
    }
});
