Id Name Action
941 Jack Thompson Hang Glider Sisters Blahblah
942 Jolly Jackal Blahblah
943 Bad Bat Blahblah
944 Real Rook Blahblah
945 Ingenious Programming Domination Blahblah
946 Musical Paintball Punishment Blahblah
947 Japanese Boxing Knights Blahblah
948 Distinct Dormouse Blahblah
949 Upset Unicorn Blahblah
950 Testy Tapir Blahblah
951 Final Sunshine Dash Blahblah
952 Innocent Impala Blahblah
953 Puzzled Penguin Blahblah
954 Fair Falcon Blahblah
955 Jolly Jellyfish Blahblah
956 Famous Fly Blahblah
957 Tender Tarsier Blahblah
958 Gentle Goosander Blahblah
959 The Last Karaoke from Mars Blahblah
960 Unsightly Unicorn Blahblah
( Items: 941 - 960 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;
}