When the grid is refreshed with grid.refresh(), regrouping and resorting is not done automatically; as a result, any updates to the underlying dataItems that affect sorting or grouping are not reflected in the grid. That level of control should be available to the developer. Therefore, I would like to suggest that the grid.refresh() method accept an optional configuration object:
var options
= { resort: true|false (default), regroup : true|false (default)}
grid.refresh( options )
In this way, if the grid is groupede by [department] for example, and the [department] of certain rows is changed programmatically via dataItem["department"] = somethingDifferent, when the grid.refresh ({regroup: true}) method is invoked with the optional argument, the grid would be regrouped, reflecting those changes to the rows' dataItems.