I use the following code in a list to produce autonumbering of the rows:
$rownum = $model->limitStart; $data = $args[0]->data; foreach ($data as $group) {