Id Name Birthday Action
1001 sss 12. 6. 2024
1002 moje 12. 6. 2024
1003 tvoje 12. 6. 2024
1004 xxx 12. 6. 2024
1005 Ahoj! 12. 6. 2024
1006 Ahoj click 12. 6. 2024
1007 111 12. 6. 2024
1008 tesa111 12. 6. 2024
1009 Klikam na enter 12. 6. 2024
1010 klikam na enter22222222 12. 6. 2024
1011 lplplpl 2. 7. 2024
1012 fdsfsd 5. 7. 2024
1013 Nová položka 2. 8. 2024
1014 Ccv 10. 9. 2024
1015 Ccv 10. 9. 2024
1016 ASD 16. 9. 2024
1017 jjj 24. 9. 2024
1018 adsfadsf 26. 9. 2024
1019 testUser 29. 9. 2024
1020 fghggf 16. 11. 2024
( Items: 1001 - 1020 from 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->setItemsDetail();

	$grid->setTemplateFile(__DIR__ . '/Templates/grid/item-detail-grid.latte');

	return $grid;
}