Id Name Birthday Status
561 Crazy Pogo Bastards 5. 11. 1993 active
562 Fantastic Turtle Odyssey 13. 3. 1943 active
563 Naughty Unicorn Inferno 6. 6. 1947 active
564 Yawning Yacare 17. 10. 1944 active
565 Cheerful Camel 10. 10. 1937 active
566 Musical Thief Boxing 16. 4. 1955 active
567 Lucky Lion 21. 6. 1959 active
568 Combative Chicken 6. 2. 1956 active
569 Gothic Mall Story 16. 2. 1941 active
570 Paranoid College Fiesta 17. 1. 1931 inactive
571 Defiant Dogfish 2. 11. 1977 active
572 Blue Barracuda 4. 2. 1970 active
573 Legend of Blade - The Dark Project 21. 10. 1955 active
574 Glorious Goose 26. 9. 1938 active
575 Envious Eel 1. 2. 1977 active
576 Innocent Iguana 17. 11. 1968 active
577 Profane Animal in the Outback 8. 9. 1949 active
578 Unbelievable Moped Jamboree 3. 9. 1968 active
579 Sleepy Swiftlet 7. 6. 1991 active
580 Nasty Barbarian vs. Capcom 14. 1. 1966 active
( Items: 561 - 580 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;
}