Id Name Birthday Age
489 3D Amish Solid 2. 12. 1986 37
492 8-Bit Paintball Fiesta 28. 6. 1950 73
184 8-Bit WWE World 6. 2. 1939 85
582 A Boy and His Dog Strikes Again 10. 5. 1945 78
874 Adorable Addax 17. 6. 1931 92
645 Adorable Anteater 21. 2. 1937 87
142 Adventurous Aardvark 27. 10. 1945 78
635 Adventurous Addax 5. 8. 1986 37
236 Adventurous Albatross 10. 10. 1949 74
803 Adventurous Angelfish 18. 10. 1996 27
655 Adventurous Armadillo 16. 8. 1961 62
608 Adventurous Armadillo 8. 1. 1972 52
365 Aero Jetski Assault 6. 11. 1942 81
748 Aero Outlaw of Mystery 10. 9. 1982 41
242 Aero Shopping Unit 22. 2. 1971 53
638 Aggressive Alpaca 17. 8. 1987 36
28 Aggressive Angelfish 12. 3. 1951 73
165 Aggressive Antelope 9. 11. 1945 78
253 Agreeable Anteater 7. 5. 1974 49
627 Agreeable Alligator 8. 6. 1967 56
( Items: 1 - 20 from 1000 )
  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(function (Row $row): int {
			return $row['birth_date']->diff(new DateTime())->y;
		});

	return $grid;
}