Id Name Birthday Age
241 Long Lapwing 19. 5. 1953 71
242 Aero Shopping Unit 22. 2. 1971 53
243 Prickly Panda 3. 11. 1937 87
244 Screaming Conga Train 28. 8. 1964 60
245 Smiling Shark 14. 5. 1983 41
246 Fair Fowl 24. 9. 1956 68
247 Dizzy Dog 25. 6. 1969 55
248 Sid Meier Sandwich Studio 3. 7. 1972 52
249 Obsessive-Compulsive Pony Desperadoes 11. 3. 2000 24
250 Master Chief Stapler Ultra 25. 2. 1996 28
251 Unremarkable Stick Struggle 28. 5. 1942 82
252 Brain-Damaged Cannibal Rider 5. 1. 1960 64
253 Agreeable Anteater 7. 5. 1974 50
254 In Search of Office Exhibition 6. 7. 1998 26
255 Encouraging Echidna 2. 2. 1975 49
256 Ashamed Aardvark 11. 12. 1961 62
257 Prickly Puffin 11. 2. 1994 30
258 Brave Bee 7. 10. 1985 39
259 Joyous Jellyfish 10. 8. 1970 54
260 Anxious Addax 19. 6. 1956 68
( Items: 241 - 260 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;
}