Id Name Action
161 Arcane Sailor Smackdown Blahblah
162 Giant Wedding Trainer Blahblah
163 Fine Flatworm Blahblah
164 Clumsy Chicken Blahblah
165 Aggressive Antelope Blahblah
166 Obsessive-Compulsive Makeover of the Blood God Blahblah
167 Beautiful Paintball Nation Blahblah
168 King of Dragon - The Dark Project Blahblah
169 Elated Elephant Blahblah
170 Real Rabbit Blahblah
171 Angry Ape Blahblah
172 Encouraging Eland Blahblah
173 Ancient Devil Stars Blahblah
174 Viking Sunshine Mania Blahblah
175 Death-Defying Boxing from Outer Space Blahblah
176 Stormy Sardine Blahblah
177 Mega Man Insect Blaster Blahblah
178 Odd Ocelot Blahblah
179 Precious Pollan Blahblah
180 Condemned Crab Blahblah
( Items: 161 - 180 from 1019 )
  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;
}