Abu Malik Ash’ari (ra) related: The Prophet (saw) would take care of these things before commencing the prayer - that the rows of the men were at the front and the children behind them. The prophet (saw) would then state “This is the Salah of my Ummah” (Sunan Abu Dawood, vol 1, p98)
Assalamu alaykum When we take our children to some duniyavi mahfil we take care of our children, we prepare them for the occasion, the discipline to be followed in the crowd. When elders are chatting how should the children behave etc. But when coming to durbar of Allah SWT, everything is forgotten. I have experienced that the children push one another, many times I was pushed and about to fall etc., their pricking each other, bashing, chit chatting, running from one place to another. etc. But I cannot tell anything to them neither the Imam could say anything, reason this masjid is in neighbourhood of intellectuals*.