Id Name Action
121 Revenge of the Kabuki in the Bayou Blahblah
122 Telekinetic Police from Hell Blahblah
123 Allied Racing 25th Anniversary Edition Blahblah
124 Rockin' Fun from Mars Blahblah
125 Relieved Ray Blahblah
126 Ho-Hum Pogo Annihilation Blahblah
127 Inappropriate Furry Roundup Blahblah
128 Blasphemous Fishing Man Blahblah
129 Pixellated Kart Fighter Blahblah
130 Hilarious Herring Blahblah
131 Irritating Boxing Runner Blahblah
132 Repulsive Rhinoceros Blahblah
133 Cautious Corncrake Blahblah
134 Orbital Jungle Legend Blahblah
135 Subatomic Goth Stadium Blahblah
136 Crazy Cowfish Blahblah
137 Anxious Albatross Blahblah
138 Elegant Emu Blahblah
139 Spectacular Shadow Returns Blahblah
140 The Robot in Middle-Earth Blahblah
( Items: 121 - 140 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;
}