Id Name Birthday Age
821 Legacy of City Ultra 12. 5. 1945 79
822 Micro Princess Returns 26. 11. 1939 84
823 Confused Camel 18. 10. 1966 58
824 Grieving Goose 12. 2. 1956 68
825 Expensive Eel 11. 9. 1991 33
826 Bling Bling Chef Derby 19. 8. 1998 26
827 Relieved Rattlesnake 13. 7. 1938 86
828 Smoggy Skylark 18. 7. 1948 76
829 Annoying Angelfish 19. 4. 1957 67
830 Gleaming Goosander 28. 9. 1986 38
831 Colonial Shopping Park 7. 7. 1973 51
832 Xenophobic Xenomorph 22. 8. 1991 33
833 Inquisitive Ibis 10. 2. 1947 77
834 Kind Katipo 26. 7. 1950 74
835 Ho-Hum Cowboy Deluxe 14. 2. 1946 78
836 Deadly Snowboard Strike Force 24. 4. 1940 84
837 Shiny Seahorse 14. 8. 1994 30
838 Energetic Eel 7. 4. 1992 32
839 Bored Bee 23. 4. 1974 50
840 Soviet Soccer Daredevils 19. 6. 1976 48
( Items: 821 - 840 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;
}