Id Name Birthday Status
141 Silent Harpoon Saloon 13. 2. 1995 deleted
142 Adventurous Aardvark 27. 10. 1945 inactive
143 Disney Bingo - The Dark Project 17. 12. 1943 deleted
144 Unsightly Unicorn 15. 6. 1989 active
145 Prickly Parrot 20. 11. 1990 deleted
146 Colorful Corncrake 3. 2. 1953 deleted
147 Distinguished Bungie in the Middle East 27. 8. 1942 inactive
148 Sinister Banana Interactive 24. 8. 1988 deleted
149 Shrunken Dentist Preacher 12. 6. 1978 deleted
150 Everybody Hates the Dungeon Massacre 11. 1. 1964 deleted
151 Enchanting Eland 2. 9. 1986 deleted
152 Obedient Ostrich 8. 2. 1959 deleted
153 Surprise Afro Palace 13. 10. 1941 deleted
154 Homeless Hedgehog 19. 11. 1959 active
155 Unforgettable Bazooka Revisited 4. 2. 1964 deleted
156 Better Badger 2. 10. 1983 deleted
157 Religious Trailer Park EX 6. 7. 1978 inactive
158 Quiet Cyborg Smash 25. 5. 1996 deleted
159 Crazy Capuchin 25. 2. 1992 deleted
160 Fragile Flamingo 6. 5. 1995 active
( Items: 141 - 160 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;
}