Id Jméno Narozky Věk
841 Grotesque Gull 13. 4. 1962 62
842 Blasphemous Thunder Conquest 18. 10. 1981 43
843 Impossible Impala 13. 3. 1936 88
844 Political Sandwich Hunt 7. 8. 1995 29
845 Russian Disco Groove 23. 11. 1987 37
846 Impossible Impala 28. 2. 1986 38
847 Epic Ice Cream Pioneer 19. 8. 1987 37
848 Powerful Piranha 5. 5. 1941 83
849 Selfish Seal 8. 4. 1950 74
850 Obnoxious Ox 9. 10. 1976 48
851 Important Impala 2. 6. 1969 55
852 Amused Angelfish 6. 12. 1991 32
853 Obedient Ocelot 21. 8. 1944 80
854 Wide-eyed Worm 15. 6. 1996 28
855 Kabuki Biplane Shack 12. 3. 1949 75
856 Handsome Hedgehog 28. 7. 1995 29
857 Lazy Lapwing 27. 7. 1939 85
858 Hitler Software Overdrive 11. 1. 1972 52
859 The Castle of Aerobics Warfare 4. 11. 1960 64
860 Tired Tortoise 12. 5. 1939 85
( Položky: 841 - 860 z 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);

	$translator = new SimpleTranslator([
		'contributte_datagrid.no_item_found_reset' => 'Žádné položky nenalezeny. Filtr můžete vynulovat',
		'contributte_datagrid.no_item_found' => 'Žádné položky nenalezeny.',
		'contributte_datagrid.here' => 'zde',
		'contributte_datagrid.items' => 'Položky',
		'contributte_datagrid.all' => 'všechny',
		'contributte_datagrid.from' => 'z',
		'contributte_datagrid.reset_filter' => 'Resetovat filtr',
		'contributte_datagrid.group_actions' => 'Hromadné akce',
		'contributte_datagrid.show_all_columns' => 'Zobrazit všechny sloupce',
		'contributte_datagrid.hide_column' => 'Skrýt sloupec',
		'contributte_datagrid.action' => 'Akce',
		'contributte_datagrid.previous' => 'Předchozí',
		'contributte_datagrid.next' => 'Další',
		'contributte_datagrid.choose' => 'Vyberte',
		'contributte_datagrid.execute' => 'Provést',

		'Name' => 'Jméno',
		'Birthday' => 'Narozky',
		'Age' => 'Věk',
	]);

	$grid->setTranslator($translator);

	return $grid;
}