Id Name Birthday Age
21 Ebony Bass Temple 15. 9. 1956 67
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 84
28 Aggressive Angelfish 12. 3. 1951 73
29 Beautiful Boar 7. 7. 1987 36
30 Go Go Pogo All-Stars 10. 5. 2000 23
31 Rock 'n' Roll Metal Assassins 21. 3. 1966 58
32 Dr. Spelunking Kingdom 18. 9. 1999 24
33 Amused Alpaca 6. 8. 1941 82
34 World of Bubble Gone Wild 11. 10. 1969 54
35 Delightful Dove 3. 4. 1989 35
36 Anxious Ant 27. 10. 1986 37
37 Big-Time Chef Blast 25. 5. 1970 53
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 1000 )
  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(function (Row $row): int {
			return $row['birth_date']->diff(new DateTime())->y;
		});

	return $grid;
}