Id Jméno Narozky Věk
241 Long Lapwing 19. 5. 1953 71
242 Aero Shopping Unit 22. 2. 1971 53
243 Prickly Panda 3. 11. 1937 87
244 Screaming Conga Train 28. 8. 1964 60
245 Smiling Shark 14. 5. 1983 41
246 Fair Fowl 24. 9. 1956 68
247 Dizzy Dog 25. 6. 1969 55
248 Sid Meier Sandwich Studio 3. 7. 1972 52
249 Obsessive-Compulsive Pony Desperadoes 11. 3. 2000 24
250 Master Chief Stapler Ultra 25. 2. 1996 28
251 Unremarkable Stick Struggle 28. 5. 1942 82
252 Brain-Damaged Cannibal Rider 5. 1. 1960 64
253 Agreeable Anteater 7. 5. 1974 50
254 In Search of Office Exhibition 6. 7. 1998 26
255 Encouraging Echidna 2. 2. 1975 49
256 Ashamed Aardvark 11. 12. 1961 62
257 Prickly Puffin 11. 2. 1994 30
258 Brave Bee 7. 10. 1985 39
259 Joyous Jellyfish 10. 8. 1970 54
260 Anxious Addax 19. 6. 1956 68
( Položky: 241 - 260 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;
}