Id Name Status Action
641 Dangerous Kangaroo Party
642 Nasty Narwhal
643 Nice Nightingale
644 Mushy Mole
645 Adorable Anteater
646 Maniac Spatula Tycoon
647 Confused Cheetah
648 Shy Serval
649 Demonic Sex Express
650 Jittery Jay
651 Fisher Price Yeti Dancers
652 Cute Chicken
653 Fair Flatworm
654 Joyous Jackal
655 Adventurous Armadillo
656 Deadly Bazooka Hunter
657 Blissful Amish Combat
658 Fancy Falcon
659 First-Person Katana Task Force
660 Drab Deer
( Items: 641 - 660 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;
}