Id Name Action
681 Phoenix Wright: Boxing Princess Blahblah
682 We Love Desert Blaster Blahblah
683 Intense Balloon Tale Blahblah
684 Thoughtful Toad Blahblah
685 Successful Stag Blahblah
686 Sore Starling Blahblah
687 Zombie Spelling on the Oregon Trail Blahblah
688 Generic Jackhammer of Love Blahblah
689 Tired Tapir Blahblah
690 Eco-Friendly Helicopter Pimps Blahblah
691 The Simpsons' Theme Park in Busytown Blahblah
692 Distinguished Cardboard vs. Capcom Blahblah
693 Dizzy Dingo Blahblah
694 Zany Zebra Blahblah
695 M.C. Escher Blimp Struggle Blahblah
696 Wrath of the Cardboard Bastards Blahblah
697 Children of the Manlove from Hell Blahblah
698 Dead Dolphin Blahblah
699 Cthulhu Godzilla Dudes Blahblah
700 Yucky Yacare Blahblah
( Items: 681 - 700 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;
}