Id Name Action
581 Children of the Donkey Arena Blahblah
582 A Boy and His Dog Strikes Again Blahblah
583 Intelligent Catapult Trader Blahblah
584 Big Terrorist Conquest Blahblah
585 Forgotten Pinball Gone Wild Blahblah
586 Envious Elephant Blahblah
587 Amused Albatross Blahblah
588 Amused Albatross Blahblah
589 Omega Sunshine Hell Blahblah
590 Communist Stick Explosion Blahblah
591 Wooden Penguin Slayer Blahblah
592 Little Karaoke Adventure Blahblah
593 John Romero Army Planet Blahblah
594 Combative Constrictor Blahblah
595 Pixellated Flatulence Daredevils Blahblah
596 Bonk Dance Demolition Blahblah
597 Secret of the Vocabulary Wranglers Blahblah
598 Easy Eland Blahblah
599 Sparkling Sheep Blahblah
600 Maniac Software in Middle-Earth Blahblah
( Items: 581 - 600 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;
}