Id Name Status Action
21 Ebony Bass Temple
22 Uptight Unicorn
23 Inbred Blood Conspiracy
24 Real Thunder Saga
25 Hungry Hummingbird
26 Good Goose
27 Unusual Unicorn
28 Aggressive Angelfish
29 Beautiful Boar
30 Go Go Pogo All-Stars
31 Rock 'n' Roll Metal Assassins
32 Dr. Spelunking Kingdom
33 Amused Alpaca
34 World of Bubble Gone Wild
35 Delightful Dove
36 Anxious Ant
37 Big-Time Chef Blast
38 Rural Chocobo Journey
39 Dynamite Go-Kart Superstar
40 Sonic Monster of Magic
( Items: 21 - 40 from 1020 )
  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->addColumnNumber('id', 'Id')
		->setAlign('start')
		->setFilterText();

	$grid->addColumnText('name', 'Name')
		->setFilterText();

	$grid->addColumnStatus('status', 'Status');

	$inlineAdd = $grid->addInlineAdd();

	$inlineAdd->setPositionTop()->onControlAdd[] = function ($container): void {
		$container->addText('name', '')
			->setRequired('aaa');
		$container->addText('birth_date', '');
		$container->addText('link', '');
		$container->addSelect('status', '', [
			'active' => 'Active',
			'inactive' => 'Inactive',
			'deleted' => 'Deleted',
		]);
	};

	$inlineAdd->onSubmit[] = function ($values): void {
		$this->dibiConnection->insert(
			'users',
			[
				'name' => $values['name'],
				'status' => $values['status'],
				'countries_visited' => 1,
				'birth_date' => new DateTime(),
			]
		)->execute();
		$this->flashMessage('Record was added!', 'success');
		$this->redrawControl('flashes');
	};

	return $grid;
}