In this paper a distributed event-triggered control of an islanded network of microgrids is proposed. Microgrids are connected to their neighbors from the point of view of energy exchange and data communication level. The control objective consists of driving the state of charge of batteries to a desired attractor, managing the connections, and disconnections of energy transfer. The control design and asymptotic convergence analysis is based on hybrid dynamical system theory, considering the state of charge of batteries and powers as continuous-time variables and the connections and disconnections among microgrids as discrete-time variables. The stability properties of a given attractor are guaranteed even when an unintentional connection/disconnection of any microgrid element occurs or when any battery is saturated in any of its bounds. This attractor is selected as a trade-off between reaching a small size of a consensus neighbourhood among the state of charge of the batteries and reducing the energy losses associated with the interconnections between microgrids.