Id Name Action
981 Dwarven Bomberman Showdown Blahblah
982 Sleepy Stoat Blahblah
983 Busy Buzzard Blahblah
984 Calm Caterpillar Blahblah
985 M.C. Escher Bass Thieves Blahblah
986 My Little Punching vs. The Space Mutants Blahblah
987 The Muppets Computer EX Blahblah
988 Rad Bandicoot on Wheels Blahblah
989 God of Ninja Spree Blahblah
990 Filthy Fly Blahblah
991 Anxious Anteater Blahblah
992 Infinite Biplane in the Desert Blahblah
993 Smiling Seahorse Blahblah
994 Brave Beetle Blahblah
995 Testy Tern Blahblah
996 Modern Moth Blahblah
997 Faithful Ferret Blahblah
998 Helpless Hawk Blahblah
999 Enraged Internet Base Blahblah
1 000 Wide-eyed Warbler Blahblah
( Items: 981 - 1000 from 1016 )
  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->setSortable();

	$grid->addColumnNumber('id', 'Id')
		->setAlign('start')
		->setSortable();

	$grid->addColumnText('name', 'Name')
		->setSortable();

	$multiAction = $grid->addMultiAction('multi_blah', 'MultiAction')
		->addAction('blah', 'Blahblah', 'blah!')
		->addAction('blah2', 'Blahblah2', 'blah!', ['name']);

	$multiAction
		->getAction('blah2')
		->setIcon('check');

	$grid->addAction('blah', 'Blahblah', 'blah!')
		->setClass('btn btn-xs btn-primary ajax');

	$grid->addAction('this', '')
		->setIcon('redo')
		->setClass('btn btn-xs btn-success');

	$actionCallback = $grid->addActionCallback('custom_callback', '');

	$actionCallback
		->setIcon('sun')
		->setTitle('Hello, sun')
		->setClass('btn btn-xs btn-default btn-secondary ajax');

	$actionCallback->onClick[] = function ($itemId): void {
		$this->flashMessage('Custom callback triggered, id: ' . $itemId);
		$this->redrawControl('flashes');
	};

	$grid->addAction('delete', '', 'delete!')
		->setIcon('trash')
		->setTitle('Delete')
		->setClass('btn btn-xs btn-danger ajax')
		->setConfirmation(
			new StringConfirmation('Do you really want to delete example %s?', 'name')
		);

	$grid->addToolbarButton('this', 'Toolbar')->addAttributes(['foo' => 'bar']);
	$grid->addToolbarButton('this#2', 'Button', ['foo' => 'bar']);

	return $grid;
}