Good evening.
Approximately so
return $this->redirect(['index', '#' => 'custom-order-form']);
Go to the index page,
PS
For lines specify the id parameter, which will contain the record id in the database. Let it be a column "id" in the GridView table though so the value may be specified for any cell.
[ 'attribute' => 'id', 'headerOptions' => ['class' => 'head-id-column'], 'contentOptions' => function($model){ return ['id' => 'test-' . $model->id]; } ],
Further, in the controller prescribes the redirect with the desired parameter.
return $this->redirect(['index', '#' => 'test-' . $id]);
All the "anchor" is ready.
P. S. S
Or. 'Don't do 'contentOptions', and make 'rowOptions'.
GridView::widget([ 'dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'rowOptions' => function($model){ return ['id' => 'test-' . $model->id]; }, 'columns' => [ // rest of code ], ]);