Id Name Birthday Age
901 Zany Zebra 17. 1. 1973 51
902 Jamaican Walrus Corps 7. 5. 1984 40
903 Outrageous Osprey 1. 5. 1946 78
904 Better Boar 10. 4. 1978 46
905 Disgusted Dunlin 17. 11. 1974 50
906 Disgusted Dingo 8. 10. 1938 86
907 Cheerful Cormorant 19. 2. 1971 53
908 Trendy Bubble Camp 27. 12. 1931 92
909 Sinister Fighter Romp 18. 8. 1967 57
910 Ugliest Unicorn 28. 10. 1950 74
911 Grumpy Gerbil 28. 11. 1949 74
912 Fatal Kitchen Master 22. 1. 1946 78
913 Ugliest Unicorn 7. 12. 1989 34
914 Bizarro Spork Melee 12. 7. 1982 42
915 Quaint Quetzal 12. 9. 1976 48
916 Good Guanaco 7. 5. 1994 30
917 Italian Burger in Vegas 11. 6. 1945 79
918 Fruity Chase Quiz 2. 4. 1981 43
919 Pleasant Penguin 12. 5. 1983 41
920 Telekinetic Hillbilly Odyssey 27. 8. 1950 74
( Items: 901 - 920 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;
}