Id Name Birthday Status
41 Chinese Spelunking Battle 13. 5. 1943 active
42 Masters of the Programming Trilogy 18. 8. 1990 deleted
43 Depressing Sudoku Arena 18. 12. 1967 deleted
44 Merciless Nazi Strike Force 27. 5. 1964 active
45 Grimy Mall Gaiden 21. 9. 1992 active
46 Cute Constrictor 19. 10. 1938 deleted
47 Defeated Dove 26. 1. 1938 deleted
48 Talented Teira 22. 6. 1995 deleted
49 Grumpy Goldfinch 11. 4. 1983 deleted
50 Golden Cardboard Ultra 15. 12. 1939 deleted
51 Amazon Elevator Agent 22. 9. 1987 active
52 All-Star Cheese Dash 2. 7. 1983 deleted
53 Nutty Nightingale 10. 4. 1993 deleted
54 Defeated Dog 11. 6. 1997 active
55 Dull Dormouse 25. 10. 1967 deleted
56 Graceful Gazelle 27. 11. 1993 deleted
57 Precious Pig 24. 10. 1958 deleted
58 Special Chase Hop-A-Bout 28. 6. 1975 active
59 Smiling Sandpiper 14. 5. 1993 deleted
60 Yucky Yak 19. 10. 1995 active
( Items: 41 - 60 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;
}