Id Jméno Narozky Věk
381 Blue-eyed Bug 5. 10. 1977 47
382 Revenge of Chicken Explosion 14. 3. 1971 53
383 Dirty Sushi Warfare 2. 1. 1988 36
384 Disney Unicycle Superstar 9. 4. 1970 54
385 Xenophobic Xenomorph 21. 5. 1978 46
386 Drab Dragonfly 25. 5. 1941 83
387 Sore Snake 10. 1. 1977 47
388 Surprise Stick All-Stars 25. 7. 1941 83
389 Musical Racing Spies 4. 2. 1952 72
390 Radical Zamboni Agent 3. 6. 1930 94
391 Bright Beetle 15. 5. 1992 32
392 The Sims: Shaving Punch-Out!! 6. 1. 1967 57
393 Ultraviolent Karate Remix 26. 6. 1990 34
394 Glamorous Gerenuk 5. 7. 1972 52
395 Sid Meier Rollerball Heroes 26. 2. 1933 91
396 Naughty Newt 22. 7. 1996 28
397 Mr. Alligator 95 25. 2. 1972 52
398 Beautiful Bear 7. 11. 1941 83
399 Difficult Dove 11. 2. 1932 92
400 Determined Dragonfly 18. 9. 1988 36
( Položky: 381 - 400 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;
}