Grouping and hiding columns

Is this possible using DHTMLX? I havea requirement for the following:
Grid with two columns, both groupable but with only the groupedby column visible.

So, for example, grid with column A and B.
Initially, column A is visible and grouped. Column B is hidden and ungrouped.
Clicking on the header for column A ungroups it, hides it and makes B visible and grouped.
Clicking on the column header switches again.

So, it looks like the columns change from A to B in the same place with the grouping in that column.

I see that there is no column select action on a grid so I am not sure if this is possible.

Any suggestions?

API of grid allows to group and hide columns, so, technically, the above scenario is possible.
As for clicking events - grid provides onHeaderClick handler, which can be used to trigger necessary grouping actions.