Id Name Action
801 Strange Seahorse Blahblah
802 Battle Buddhist Massacre Blahblah
803 Adventurous Angelfish Blahblah
804 Viking Cricket Extra Blahblah
805 Lair of the Gun Championship Blahblah
806 Tropical Catapult Strikes Back Blahblah
807 Shiny Salamander Blahblah
808 Unsightly Unicorn Blahblah
809 Disturbed Dingo Blahblah
810 Tense Thrush Blahblah
811 Arcane Jetpack Frenzy Blahblah
812 Xerothermic Xenomorph Blahblah
813 Alive Anteater Blahblah
814 Bonk Spatula in Vegas Blahblah
815 Light Llama Blahblah
816 Average Anaconda Blahblah
817 Dance Dance Night City Blahblah
818 Jolly Jellyfish Blahblah
819 Energetic Elk Blahblah
820 Atomic Carnival X Blahblah
( Items: 801 - 820 from 1019 )
  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;
}