Id Name Birthday Age
801 Strange Seahorse 19. 4. 1973 51
802 Battle Buddhist Massacre 18. 12. 1971 52
803 Adventurous Angelfish 18. 10. 1996 28
804 Viking Cricket Extra 17. 6. 1985 39
805 Lair of the Gun Championship 23. 5. 1933 91
806 Tropical Catapult Strikes Back 27. 12. 1991 32
807 Shiny Salamander 5. 3. 1959 65
808 Unsightly Unicorn 4. 6. 1996 28
809 Disturbed Dingo 16. 5. 1977 47
810 Tense Thrush 20. 1. 1955 69
811 Arcane Jetpack Frenzy 20. 3. 1972 52
812 Xerothermic Xenomorph 2. 1. 1940 84
813 Alive Anteater 2. 3. 1999 25
814 Bonk Spatula in Vegas 2. 9. 1931 93
815 Light Llama 13. 11. 1961 63
816 Average Anaconda 14. 5. 1941 83
817 Dance Dance Night City 7. 12. 1931 92
818 Jolly Jellyfish 6. 11. 1950 74
819 Energetic Elk 4. 3. 1982 42
820 Atomic Carnival X 21. 1. 1960 64
( Items: 801 - 820 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;
}