Id Name Birthday Status
761 Vivacious Vendace 10. 2. 1948 active
762 Grotesque Gannet 6. 8. 1987 active
763 Doubtful Deer 7. 7. 1930 deleted
764 Grieving Grouse 19. 6. 1949 active
765 Insane Rugby of Might and Magic 24. 1. 1996 deleted
766 Unpleasant Volleyball Caper 22. 8. 1973 deleted
767 Heavy Chase Explosion 26. 4. 1966 deleted
768 Friendly Fish 21. 10. 1970 deleted
769 Lost Puzzle Voyage 1. 11. 1979 deleted
770 The Six Million Dollar Sniper Tycoon 4. 7. 1998 deleted
771 Enchanting Echidna 3. 2. 1981 deleted
772 BudgetSoft Presents: Plumber Train 4. 3. 1965 active
773 Future Quiz Desperadoes 24. 9. 1948 deleted
774 Psycho Banana Overlords 8. 9. 1961 active
775 Thankful Teira 15. 5. 1998 deleted
776 College Dance Siege 22. 9. 1951 deleted
777 Rich Reindeer 2. 8. 1957 active
778 Heroic Graveyard Fiesta 20. 12. 1963 deleted
779 Annoyed Anteater 26. 5. 1964 deleted
780 Confused Cheetah 5. 9. 1960 active
( Items: 761 - 780 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;
}