Id Jméno Narozky Věk
401 Summer Underwear Trivia 10. 5. 1974 50
402 Proud Pelican 18. 11. 1992 32
403 Victorious Vendace 25. 4. 1944 80
404 Innocent Ibis 5. 1. 1964 60
405 Tender Tern 9. 6. 1990 34
406 Odd Okapi 5. 5. 1957 67
407 Frail Frog 13. 2. 1965 59
408 Wooden Guitar Diesel 22. 10. 1950 74
409 Hip-Hop Vigilante Ultra 22. 11. 1964 60
410 The Last Cannibal Rebellion 8. 10. 1950 74
411 Raging Drug-Dealing Heroes 2. 1. 1988 36
412 Important Ibis 7. 11. 1995 29
413 Comfortable Corncrake 22. 11. 1931 93
414 We Love Banjo Crime Scene Investigation 11. 1. 1962 62
415 Samba de Mall from Outer Space 18. 12. 1933 90
416 Star Octopus Gladiator 4. 2. 1988 36
417 Transvestite Princess Fighter 19. 10. 1946 78
418 Dr. Spelling Alpha 3. 2. 1971 53
419 Bloody Bear 21. 3. 1936 88
420 Claustrophobic Afro Co-Op 6. 3. 1981 43
( Položky: 401 - 420 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;
}