Master detail feature to expand row is not there if Optimize code is checked for table

We have a requirement to present read only data in table. We should be able to do the following

1. Customize table, save the view

2. re-order columns

3. Expand collapse the row to show details

Since our data for the table can come from non pega sources we have to use Data page as the source for the table.

We have observed that if we check the flag "Optimize code" to Allow we are loosing the feature Master detail from the Operations tab along with that goes the expand collapse functionality.

Can you please suggest why Pega is not providing us that functionality and how can we achieve this requirement?

***Edited by Moderator Marissa to update platform capability tags****