How can I show child doctype with filtered records based on record of another child?

I want to show a child table when user clicks on the button field of another child and child table shown should filter the record based on the field of button clicked.