See the Pen Change grouping column programmatically by christianacca (@christianacca) on CodePen.