This page is Asset Page.

This tree is /content/dam for Asset in CRXDE Lite.

When I unpublished parent folder(ex:parent) in Asset Page, all children folders(ex:child1, child2,) and all children files(ex:file01.doc, file02.txt, file03.pptx,file04.xlsx) unpublished automatically.
But when I published parent folder(ex:parent) in Asset Page, all children folders(ex:child1, child2,) and all children files(ex:file01.doc, file02.txt, file03.pptx,file04.xlsx) did not publish automatically.
Parent folder(ex:parent) published only.
I can not understand why.
So, Because of that, child has activated child only In line 187 of my source code like below that.

In addition, In my source code, I want to implement the method that activate all child folders and files when parent folder activates in asset page.
How can I implement it ?
Regards
Chung Yong.