Expand table rows for group by columns

refer Group in Table Component - #6 by Arvind

we had done this toggle setting to expand/collapse all rows using switch & JS variable.
However we want to toggle that switch back to "OFF" state when one of rows is manually collapsed.
or "ON" state when all rows are manually expanded.