Sorting of a column refering to another columns

I have a requirement, that when i sort a column ( say 4th column) which is of type string,
this should use the values in first column ( which is hidden) and apply the sort accoringly.

var baseColumnHeaders	="AcctNMAbbr,Master Cd,Pricing Cd,Account Name";
var columnSorts		="str,str,str,str";

In the above code, data will be grouped by 1st column and it will be hidden. However, when the user sorts on 4th column ( Account Name), it should refer to 1st column ( which is hidden) and sort accordingly.