Id Name Action
721 Depressed Dragonfly Blahblah
722 International Shock - The Card Game Blahblah
723 Prickly Pollan Blahblah
724 Amphibious Shopping Summit Blahblah
725 Creepy Cheetah Blahblah
726 The Great Katana Starring Mickey Mouse Blahblah
727 Arrogant Addax Blahblah
728 Mystic Chef Encounter Blahblah
729 Clumsy Caterpillar Blahblah
730 Madden Samurai Marines Blahblah
731 Stormy Sandpiper Blahblah
732 Sim Worm vs. Street Fighter Blahblah
733 Bizarre Insect Struggle Blahblah
734 Nutty Newt Blahblah
735 Confused Crab Blahblah
736 Bonk Bong in Middle-Earth Blahblah
737 Presidential Square Dancing Simulator Blahblah
738 Jewish Prison Desperadoes Blahblah
739 Black Bug Blahblah
740 Inexpensive Impala Blahblah
( Items: 721 - 740 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;
}