Skip to content

Commit a7ee823

Browse files
committed
Update documentation of sorting in grid views
1 parent 90a27a3 commit a7ee823

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

docs/php/api/grid_views.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ final class ExampleGridView extends AbstractGridView
4444
->sortable()
4545
->titleColumn()
4646
]);
47+
48+
$this->setDefaultSortField('title');
4749
}
4850

4951
#[\Override]
@@ -270,8 +272,8 @@ final class FooGridView extends AbstractGridView
270272
GridViewColumn::for('title')
271273
->sortable();
272274

273-
$this->setSortField('title');
274-
$this->setSortOrder('ASC');
275+
$this->setDefaultSortField('title');
276+
$this->setDefaultSortOrder('ASC');
275277
}
276278
}
277279
```

0 commit comments

Comments
 (0)