Id Name Birthday Status
961 Happy Blood Extravaganza 22. 10. 1936 inactive
962 Frankenstein Toon Explorer 13. 7. 1942 active
963 Maniac Vocabulary Inspector 22. 3. 1981 deleted
964 College Alien Task Force 24. 3. 1955 deleted
965 Shiny Shrike 12. 4. 1935 deleted
966 Healthy Horse 19. 11. 1935 deleted
967 Misty Manatee 1. 11. 1959 deleted
968 Disney Night Conflict 11. 4. 1930 deleted
969 Blazing Jackhammer Crusader 23. 5. 1986 deleted
970 Victorious Vendace 18. 3. 1985 inactive
971 Panzer Gun Bandits 16. 4. 1956 active
972 Fierce Frog 3. 4. 1989 deleted
973 Bling Bling Skate Crusader 24. 10. 1991 deleted
974 Average Albatross 22. 7. 1941 deleted
975 Twisted Deer Hunter Posse 6. 1. 1985 deleted
976 Intellectual Spelling Warfare 27. 10. 1942 deleted
977 Exquisite Quiz Roundup 12. 6. 1970 deleted
978 All-Star Bible Kid 24. 6. 1930 deleted
979 Mysterious Monkey 2. 8. 1952 deleted
980 Curious Capybara 5. 5. 1930 deleted
( Items: 961 - 980 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;
}