Id Name Action
181 Underwater Donkey Princess Blahblah
182 Calm Chinchilla Blahblah
183 Bloody Bug Blahblah
184 8-Bit WWE World Blahblah
185 Glorious Goosander Blahblah
186 Prickly Pigeon Blahblah
187 Arrogant Alpaca Blahblah
188 Vast Vendace Blahblah
189 Frail Fly Blahblah
190 Shady Robot Inferno Blahblah
191 Real Raccoon Blahblah
192 Nasty Narwhal Blahblah
193 Old-fashioned Oryx Blahblah
194 Tired Thrush Blahblah
195 Fisher Price Lego Romp Blahblah
196 Misty Moose Blahblah
197 Better Buffalo Blahblah
198 Obnoxious Otter Blahblah
199 Happy Hornet Blahblah
200 Itchy Ibis Blahblah
( Items: 181 - 200 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->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;
}