Id Name Birthday Age
881 Android Piano Derby 25. 4. 1963 61
882 Nihilistic Scooter Hell 8. 10. 1948 76
883 Confused Curlew 27. 2. 1997 27
884 Jealous Jaguar 19. 9. 1977 47
885 Careful Cod 12. 7. 1996 28
886 Strange Shrike 1. 1. 1955 69
887 Scary Swiftlet 28. 8. 1988 36
888 Everybody Hates the Sumo Princess 15. 10. 1995 29
889 Puzzled Pigeon 26. 9. 1939 85
890 Maniac Paintball Rave 25. 2. 1988 36
891 Ugliest Unicorn 6. 6. 1941 83
892 Samurai Whale Underground 11. 9. 1983 41
893 Wild Worm 11. 12. 1994 29
894 Impossible Ibex 2. 7. 1943 81
895 Thankful Tarantula 5. 8. 1960 64
896 Happy Herring 20. 10. 1954 70
897 Embarrassed Eel 17. 12. 1934 89
898 Unpleasant Mushroom Corps 28. 3. 1933 91
899 Dizzy Dove 12. 12. 1969 54
900 The Six Million Dollar Whale Baseball 18. 10. 1998 26
( Items: 881 - 900 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;
}