Id Name Birthday Status
681 Phoenix Wright: Boxing Princess 20. 7. 1958 deleted
682 We Love Desert Blaster 7. 5. 1947 deleted
683 Intense Balloon Tale 28. 11. 1952 deleted
684 Thoughtful Toad 17. 6. 1957 inactive
685 Successful Stag 22. 3. 1957 active
686 Sore Starling 5. 4. 1954 deleted
687 Zombie Spelling on the Oregon Trail 22. 10. 1987 active
688 Generic Jackhammer of Love 23. 8. 1959 deleted
689 Tired Tapir 24. 3. 1969 deleted
690 Eco-Friendly Helicopter Pimps 28. 10. 1942 deleted
691 The Simpsons' Theme Park in Busytown 16. 3. 1955 deleted
692 Distinguished Cardboard vs. Capcom 18. 8. 1970 deleted
693 Dizzy Dingo 22. 7. 1967 deleted
694 Zany Zebra 1. 2. 1988 deleted
695 M.C. Escher Blimp Struggle 4. 6. 1979 deleted
696 Wrath of the Cardboard Bastards 19. 7. 1964 deleted
697 Children of the Manlove from Hell 7. 4. 1944 deleted
698 Dead Dolphin 24. 4. 1934 deleted
699 Cthulhu Godzilla Dudes 12. 6. 1978 deleted
700 Yucky Yacare 2. 6. 1930 deleted
( Items: 681 - 700 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;
}