Id Jméno Narozky Věk
321 Zealous Zebra 8. 3. 1999 25
322 Real Raccoon 6. 2. 1944 80
323 Fiery Equestrian - The Revenge 20. 8. 1947 77
324 Bad Barracuda 17. 8. 1971 53
325 Jedi Rabbit Brothers 22. 4. 1934 90
326 Invisible Driving Caper 18. 6. 1956 68
327 Stormy Spider 24. 10. 1934 90
328 Courageous Crocodile 24. 8. 1931 93
329 Clumsy Crossbill 2. 1. 1947 77
330 Colorful Chipmunk 1. 5. 1948 76
331 Sonic Castlevania Championship 14. 12. 1975 48
332 Light Ladybird 18. 10. 1942 82
333 Inexpensive Ibex 14. 6. 1975 49
334 Perfect Panda 23. 7. 1942 82
335 Depressed Duck 25. 5. 1936 88
336 Irish Motorcycle Uprising 23. 3. 1989 35
337 Curious Crossbill 3. 5. 1940 84
338 Agreeable Ant 14. 3. 1943 81
339 Enchanting Eagle 9. 2. 1941 83
340 Plain Peafowl 13. 12. 1989 34
( Položky: 321 - 340 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;
}