Id Name Birthday Age
832 Xenophobic Xenomorph 22. 8. 1991 32
385 Xenophobic Xenomorph 21. 5. 1978 45
91 Xenophobic Xenomorph 10. 2. 1958 66
15 Xenophobic Xenomorph 3. 3. 1987 37
781 Xenophobic Xenomorph 23. 12. 1994 29
812 Xerothermic Xenomorph 2. 1. 1940 84
564 Yawning Yacare 17. 10. 1944 79
98 Yellowed Yacare 1. 11. 1978 45
796 Yellowed Yak 3. 3. 1993 31
619 Yellowed Yak 28. 2. 1944 80
719 Yellowed Yak 23. 8. 1931 92
700 Yucky Yacare 2. 6. 1930 93
60 Yucky Yak 19. 10. 1995 28
217 Yucky Yak 23. 8. 1938 85
540 Zany Desert Jam 25. 5. 1938 85
694 Zany Zebra 1. 2. 1988 36
901 Zany Zebra 17. 1. 1973 51
321 Zealous Zebra 8. 3. 1999 25
687 Zombie Spelling on the Oregon Trail 22. 10. 1987 36
673 Zombie Batman Struggle 28. 9. 1948 75
( Items: 981 - 1000 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;
}