Id Name Birthday Status
481 Pro Matador Stars 25. 9. 1993 active
482 Ultimate Porn Invaders 1. 10. 1961 active
483 Mushy Mosquito 6. 4. 1968 active
484 Ninja Unicycle Park 6. 10. 1967 active
485 Glowing Penguin Uprising 12. 8. 1946 deleted
486 Drug-Induced Football Uprising 23. 10. 1945 deleted
487 Muddy Macaque 16. 1. 1991 deleted
488 Maniac Castlevania Slaughter 2. 2. 1989 deleted
489 3D Amish Solid 2. 12. 1986 active
490 Fantastic Flatworm 2. 6. 1938 deleted
491 Poor Pony 9. 3. 1977 inactive
492 8-Bit Paintball Fiesta 28. 6. 1950 active
493 Handsome Hamster 15. 4. 1982 deleted
494 Ashamed Ape 11. 7. 1979 active
495 Mexican Bow Hunter Horde 4. 4. 1991 deleted
496 Lair of the Devil Syndrome 1. 9. 1965 deleted
497 Metal Robot - Hot Pursuit 19. 9. 1931 deleted
498 Enchanting Earthworm 19. 2. 2000 inactive
499 Tactical Makeover Mania 26. 11. 1990 deleted
500 Bloody Buffalo 12. 5. 1963 deleted
( Items: 481 - 500 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;
}