Id Name Birthday Status
781 Xenophobic Xenomorph 23. 12. 1994 deleted
782 Expensive Eel 26. 12. 1975 deleted
783 French Chess in Crazyland 15. 5. 1942 deleted
784 Enthusiastic Eland 22. 11. 1992 deleted
785 The Secret Weapon of the Workout Joe 8. 8. 1968 deleted
786 Britney Spears' Cricket Horror 20. 2. 1955 deleted
787 Nihilistic Baseball Yoga 1. 4. 1950 inactive
788 Blazing Ostrich - Hot Pursuit 21. 5. 1992 inactive
789 Irish Kung-fu World Tour 3. 2. 1947 deleted
790 Claustrophobic Zamboni Hero 16. 6. 1990 deleted
791 Ultimate Motocross Interceptor 8. 11. 1960 active
792 Calm Cormorant 23. 11. 1990 deleted
793 Awful Antelope 5. 2. 1984 active
794 Tired Tortoise 24. 10. 1944 deleted
795 Exciting Afro Conspiracy 20. 4. 1975 deleted
796 Yellowed Yak 3. 3. 1993 deleted
797 Proud Pheasant 26. 12. 1954 active
798 Frightened Frog 4. 2. 1953 deleted
799 Dead or Alive Gun Online 8. 3. 1988 deleted
800 Day of the Lawnmower Creator 18. 12. 1963 deleted
( Items: 781 - 800 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]);

	$grid->addColumnNumber('id', 'Id')
		->setAlign('start')
		->setSortable();

	$grid->addColumnText('name', 'Name')
		->setSortable()
		->setFilterText();

	$grid->addColumnDateTime('birth_date', 'Birthday');

	$grid->addColumnText('status', 'Status');

	$grid->addExportCallback('Dump to ajax rq', function (array $rows, DataGrid $grid): void {
		echo 'All fetched data were passed to export callback. Size of data: ';
		echo count($rows);
		die;
	})->setAjax();

	$grid->addExportCsvFiltered('Csv export (filtered)', 'examples.csv')
		->setTitle('Csv export (filtered)');

	$columnName = new ColumnText($grid, 'name', 'name', 'Name');
	$columnEven = (new ColumnText($grid, 'even', 'even', 'Even ID (yes/no)'))
		->setRenderer(
			fn ($item) => $item['id'] % 2 === 0 ? 'No' : 'Yes'
		);

	$grid->addExportCsv('Csv export', 'examples-all.csv')
		->setTitle('Csv export')
		->setColumns([
			$columnName,
			$columnEven,
		]);

	return $grid;
}