Id Name Action
901 Zany Zebra Blahblah
902 Jamaican Walrus Corps Blahblah
903 Outrageous Osprey Blahblah
904 Better Boar Blahblah
905 Disgusted Dunlin Blahblah
906 Disgusted Dingo Blahblah
907 Cheerful Cormorant Blahblah
908 Trendy Bubble Camp Blahblah
909 Sinister Fighter Romp Blahblah
910 Ugliest Unicorn Blahblah
911 Grumpy Gerbil Blahblah
912 Fatal Kitchen Master Blahblah
913 Ugliest Unicorn Blahblah
914 Bizarro Spork Melee Blahblah
915 Quaint Quetzal Blahblah
916 Good Guanaco Blahblah
917 Italian Burger in Vegas Blahblah
918 Fruity Chase Quiz Blahblah
919 Pleasant Penguin Blahblah
920 Telekinetic Hillbilly Odyssey Blahblah
( Items: 901 - 920 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;
}