Id Name Action
561 Crazy Pogo Bastards Blahblah
562 Fantastic Turtle Odyssey Blahblah
563 Naughty Unicorn Inferno Blahblah
564 Yawning Yacare Blahblah
565 Cheerful Camel Blahblah
566 Musical Thief Boxing Blahblah
567 Lucky Lion Blahblah
568 Combative Chicken Blahblah
569 Gothic Mall Story Blahblah
570 Paranoid College Fiesta Blahblah
571 Defiant Dogfish Blahblah
572 Blue Barracuda Blahblah
573 Legend of Blade - The Dark Project Blahblah
574 Glorious Goose Blahblah
575 Envious Eel Blahblah
576 Innocent Iguana Blahblah
577 Profane Animal in the Outback Blahblah
578 Unbelievable Moped Jamboree Blahblah
579 Sleepy Swiftlet Blahblah
580 Nasty Barbarian vs. Capcom Blahblah
( Items: 561 - 580 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;
}