Id Name Birthday Status
581 Children of the Donkey Arena 24. 9. 1988 active
582 A Boy and His Dog Strikes Again 10. 5. 1945 inactive
583 Intelligent Catapult Trader 21. 7. 1978 deleted
584 Big Terrorist Conquest 11. 7. 1977 deleted
585 Forgotten Pinball Gone Wild 14. 7. 1947 active
586 Envious Elephant 26. 8. 1942 inactive
587 Amused Albatross 26. 11. 1962 inactive
588 Amused Albatross 14. 10. 1968 active
589 Omega Sunshine Hell 23. 4. 1976 inactive
590 Communist Stick Explosion 15. 8. 1943 inactive
591 Wooden Penguin Slayer 19. 9. 1996 deleted
592 Little Karaoke Adventure 26. 6. 1963 deleted
593 John Romero Army Planet 25. 9. 1938 inactive
594 Combative Constrictor 25. 9. 1982 active
595 Pixellated Flatulence Daredevils 27. 12. 1960 deleted
596 Bonk Dance Demolition 22. 3. 1945 active
597 Secret of the Vocabulary Wranglers 10. 4. 1961 active
598 Easy Eland 18. 9. 1967 active
599 Sparkling Sheep 4. 9. 1956 inactive
600 Maniac Software in Middle-Earth 22. 12. 1998 deleted
( Items: 581 - 600 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;
}