Id Name Birthday Age
21 Ebony Bass Temple 15. 9. 1956 68
22 Uptight Unicorn 24. 4. 1998 26
23 Inbred Blood Conspiracy 23. 3. 1960 64
24 Real Thunder Saga 6. 12. 1940 83
25 Hungry Hummingbird 15. 12. 1976 47
26 Good Goose 23. 4. 1939 85
27 Unusual Unicorn 28. 4. 1939 85
28 Aggressive Angelfish 12. 3. 1951 73
29 Beautiful Boar 7. 7. 1987 37
30 Go Go Pogo All-Stars 10. 5. 2000 24
31 Rock 'n' Roll Metal Assassins 21. 3. 1966 58
32 Dr. Spelunking Kingdom 18. 9. 1999 25
33 Amused Alpaca 6. 8. 1941 83
34 World of Bubble Gone Wild 11. 10. 1969 55
35 Delightful Dove 3. 4. 1989 35
36 Anxious Ant 27. 10. 1986 38
37 Big-Time Chef Blast 25. 5. 1970 54
38 Rural Chocobo Journey 6. 1. 1989 35
39 Dynamite Go-Kart Superstar 17. 4. 1951 73
40 Sonic Monster of Magic 13. 2. 1963 61
( Items: 21 - 40 from 1020 )
  See the code below 👇 or see GitHub
public function createComponentGrid(): DataGrid
{
	$grid = new DataGrid();

	$grid->setDataSource($this->dibiConnection->select('*')->from('users'));

	$grid->setItemsPerPageList([20, 50, 100], true);

	$grid->addColumnText('id', 'Id')
		->setSortable();

	$grid->addColumnText('email', 'E-mail')
		->setSortable()
		->setFilterText();

	$grid->addColumnText('name', 'Name')
		->setFilterText();

	$grid->addColumnDateTime('birth_date', 'Birthday')
		->setFormat('j. n. Y');

	$grid->addColumnNumber('age', 'Age')
		->setRenderer(fn (Row $row): ?int => DateTime::fromSafe($row->asDateTime('birth_date'))?->diff(new DateTime())->y);

	return $grid;
}