Custom Sort option in Subpanel

Hello,
we need customization on Task Design(TD) Subpanel.  we need an option to the action dropdown in the subpanel for "Sort by Time Window"?  If the user clicks that, it should overwrite any sorting they've done by clicking into column headers.  When the user clicks that button the subpanel should rearrange.
The records with Type = Actual - Sample Prep and Actual - Test System Specific should be moved to the top of the list.
Beyond that, the records should be organized in a nested fashion.  Relative = NA TDs should be shown as a first layer of the results.  Any TDs with Relative = 1st Tier should be nested as rows under their parent Relative = NA TD.  Any TDs with Relative = 2nd Tier should be nested as rows under their parent Relative = 1st Tier TD.  The nested groups should be organized by Time Window to show the TDs in order of completion (the Units would need to be considered).  For example, a Day -3-0 TD should be shown above a Day 0-5 TD.  A Day -7--3 TD should be shown before the Minute -45-0 TD.
 
Please help me if have anyone any solution.
Thanks,
Laxmichand saini