Id Name Action
541 Frail Finch Blahblah
542 Magnificent Mamba Blahblah
543 Itchy Impala Blahblah
544 Exquisite Furry Online Blahblah
545 Defiant Deer Blahblah
546 Final Arcade in the Bayou Blahblah
547 Brainy Beaver Blahblah
548 Graceful Gorilla Blahblah
549 Annoying Antelope Blahblah
550 Inexpensive Iguana Blahblah
551 Amazing Whale Brothers Blahblah
552 Joyous Jackal Blahblah
553 Thankful Tarantula Blahblah
554 Insane Axe School Blahblah
555 Arrogant Armadillo Blahblah
556 Armored Skate Plus Blahblah
557 Barbie Fighter Alpha Blahblah
558 Odd Otter Blahblah
559 Sparkling Snail Blahblah
560 Defiant Dugong Blahblah
( Items: 541 - 560 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;
}