Id Name Birthday Age
223 Amused Ant 26. 6. 1957 66
203 Amused Ape 10. 6. 1996 27
707 Ancient Chocobo Disaster 24. 9. 1935 88
173 Ancient Devil Stars 9. 2. 1999 25
881 Android Piano Derby 25. 4. 1963 61
368 Android Shadow Syndrome 21. 7. 1995 28
171 Angry Ape 22. 9. 1950 73
779 Annoyed Anteater 26. 5. 1964 59
232 Annoying Aardvark 26. 3. 2000 24
829 Annoying Angelfish 19. 4. 1957 67
549 Annoying Antelope 8. 3. 1982 42
6 Anxious Alpaca 25. 9. 1985 38
632 Anxious Anteater 9. 10. 1995 28
991 Anxious Anteater 17. 1. 1952 72
260 Anxious Addax 19. 6. 1956 67
137 Anxious Albatross 5. 1. 1936 88
36 Anxious Ant 27. 10. 1986 37
360 Aquatic Katana Bandits 9. 2. 1980 44
536 Aquatic Motocross Marines 16. 8. 1998 25
811 Arcane Jetpack Frenzy 20. 3. 1972 52
( Items: 41 - 60 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;
}