Id Name Action
661 German Cricket Groove Blahblah
662 Ho-Hum WWE Co-Op Blahblah
663 My First Fishing Bloodbath Blahblah
664 Indiana Jones and the Transvestite Madness Blahblah
665 Mushy Manx Blahblah
666 Magnificent Mink Blahblah
667 Open Oryx Blahblah
668 Galactic Scorched Earth Palace Blahblah
669 Pathetic Sandwich Boxing Blahblah
670 Master Chief Hammer Gone Wild Blahblah
671 Final Makeover Nightmare Blahblah
672 Muddy Mockingbird Blahblah
673 Zombie Batman Struggle Blahblah
674 Depressed Dugong Blahblah
675 The Care Bears' Business - 2nd Impact Blahblah
676 Delightful Duck Blahblah
677 Omega Hockey from Planet X Blahblah
678 Pro Robot in the Hood Blahblah
679 Magical Dating in the Magic Kingdom Blahblah
680 Amateur Yoga Crisis Blahblah
( Items: 661 - 680 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;
}