This is a little bit vague however...
If the data is not already on the client side when the user clicks the
parent, then you will need to make an AJAX call to the server to get
the children. You could use RJS to insert the popup or you could send
process it and create the popup contents.