Id Name Action
221 Forbidden Pirate Detective Blahblah
222 Unholy Karate Desperadoes Blahblah
223 Amused Ant Blahblah
224 Vast Vulture Blahblah
225 Japanese Pogo Insurrection Blahblah
226 Thoughtful Thrush Blahblah
227 Terrible Toucan Blahblah
228 American Math Wranglers Blahblah
229 Shameful Dungeon Romp Blahblah
230 Glamorous Gull Blahblah
231 Insane Battleship Island Blahblah
232 Annoying Aardvark Blahblah
233 Attractive Addax Blahblah
234 Weary Catapult Hop-A-Bout Blahblah
235 Courageous Constrictor Blahblah
236 Adventurous Albatross Blahblah
237 Glorious Gnu Blahblah
238 Full Metal Monkey Rally Blahblah
239 Big Bird Pirate Corps Blahblah
240 Frantic Finch Blahblah
( Items: 221 - 240 from 1016 )
  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;
}