In this paper, we study the dynamics of the Bose-Hubbard model with the nearest-neighbor repulsion by using time-dependent Gutzwiller methods. Near the unit filling, the phase diagram of the model contains density wave (DW), supersolid (SS) and superfluid (SF). The three phases are separated by two second-order phase transitions. We study slow-quench dynamics by varying the hopping parameter in the Hamiltonian as a function of time. In the phase transitions from the DW to SS and from the DW to SF, we focus on how the SF order forms and study scaling laws of the SF correlation length, vortex density, etc. The results are compared with the Kibble-Zurek scaling. On the other hand from the SF to DW, we study how the DW order evolves with generation of the domain walls and vortices. Measurement of first-order SF coherence reveals interesting behavior in the DW regime.