Id Name Birthday Age
321 Zealous Zebra 8. 3. 1999 25
322 Real Raccoon 6. 2. 1944 80
323 Fiery Equestrian - The Revenge 20. 8. 1947 77
324 Bad Barracuda 17. 8. 1971 53
325 Jedi Rabbit Brothers 22. 4. 1934 90
326 Invisible Driving Caper 18. 6. 1956 68
327 Stormy Spider 24. 10. 1934 90
328 Courageous Crocodile 24. 8. 1931 93
329 Clumsy Crossbill 2. 1. 1947 77
330 Colorful Chipmunk 1. 5. 1948 76
331 Sonic Castlevania Championship 14. 12. 1975 48
332 Light Ladybird 18. 10. 1942 82
333 Inexpensive Ibex 14. 6. 1975 49
334 Perfect Panda 23. 7. 1942 82
335 Depressed Duck 25. 5. 1936 88
336 Irish Motorcycle Uprising 23. 3. 1989 35
337 Curious Crossbill 3. 5. 1940 84
338 Agreeable Ant 14. 3. 1943 81
339 Enchanting Eagle 9. 2. 1941 83
340 Plain Peafowl 13. 12. 1989 34
( Items: 321 - 340 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;
}