Id Jméno Narozky Věk
941 Jack Thompson Hang Glider Sisters 6. 6. 1940 84
942 Jolly Jackal 1. 8. 1964 60
943 Bad Bat 25. 10. 1959 65
944 Real Rook 3. 2. 1971 53
945 Ingenious Programming Domination 23. 11. 1965 59
946 Musical Paintball Punishment 8. 8. 1985 39
947 Japanese Boxing Knights 25. 11. 1952 71
948 Distinct Dormouse 15. 8. 1967 57
949 Upset Unicorn 20. 10. 1981 43
950 Testy Tapir 4. 1. 1934 90
951 Final Sunshine Dash 8. 2. 1931 93
952 Innocent Impala 8. 2. 1961 63
953 Puzzled Penguin 11. 1. 1961 63
954 Fair Falcon 1. 9. 1968 56
955 Jolly Jellyfish 11. 8. 1946 78
956 Famous Fly 28. 8. 1988 36
957 Tender Tarsier 10. 7. 1941 83
958 Gentle Goosander 1. 12. 1972 51
959 The Last Karaoke from Mars 15. 4. 1975 49
960 Unsightly Unicorn 23. 2. 1963 61
( Položky: 941 - 960 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;
}