Id Name Birthday Status
701 Rich Raccoon 2. 7. 1972 active
702 Elated Eland 14. 8. 1998 active
703 Frantic Flatworm 15. 2. 1976 deleted
704 Grieving Gnat 9. 7. 1987 active
705 Itchy Ibex 4. 6. 1988 active
706 Lair of the Tank Police 11. 10. 1957 inactive
707 Ancient Chocobo Disaster 24. 9. 1935 inactive
708 Tactical Hitman Power 17. 9. 1998 deleted
709 Communist Mahjong Agent 12. 7. 1996 inactive
710 Curse of the Mafia DJ 25. 3. 1935 inactive
711 Dangerous Matador Competition 14. 7. 1938 deleted
712 Beautiful Transvestite Machine 10. 2. 1930 deleted
713 Happy Hawk 21. 2. 1950 deleted
714 Cute Cormorant 23. 4. 1930 inactive
715 Interstellar Toon Tale 9. 12. 1973 active
716 Jittery Jackal 4. 11. 1936 inactive
717 Leisure Suit Grizzly Bear - Total War 22. 11. 1976 inactive
718 Curious Crossbill 15. 7. 1991 deleted
719 Yellowed Yak 23. 8. 1931 deleted
720 Catholic Pokemon 3D 7. 11. 1951 deleted
( Items: 701 - 720 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;
}