Id Name Action
781 Xenophobic Xenomorph Blahblah
782 Expensive Eel Blahblah
783 French Chess in Crazyland Blahblah
784 Enthusiastic Eland Blahblah
785 The Secret Weapon of the Workout Joe Blahblah
786 Britney Spears' Cricket Horror Blahblah
787 Nihilistic Baseball Yoga Blahblah
788 Blazing Ostrich - Hot Pursuit Blahblah
789 Irish Kung-fu World Tour Blahblah
790 Claustrophobic Zamboni Hero Blahblah
791 Ultimate Motocross Interceptor Blahblah
792 Calm Cormorant Blahblah
793 Awful Antelope Blahblah
794 Tired Tortoise Blahblah
795 Exciting Afro Conspiracy Blahblah
796 Yellowed Yak Blahblah
797 Proud Pheasant Blahblah
798 Frightened Frog Blahblah
799 Dead or Alive Gun Online Blahblah
800 Day of the Lawnmower Creator Blahblah
( Items: 781 - 800 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;
}