Id Name Status Action
601 Concerned Cheetah
602 Joyous Jellyfish
603 Savage Outlaw Rebellion
604 Disgusted Dormouse
605 Sore Stoat
606 Helicopter Fantasy X
607 Awful Alpaca
608 Adventurous Armadillo
609 Motionless Mongoose
610 Grand Bow Hunter Terror
611 Shy Starling
612 Cautious Chimpanzee
613 Christian Makeout DJ
614 Troubled Tarantula
615 Peaceful Death Onslaught
616 Amish College EX
617 The Sims: Moon - The Quickening
618 Latino Death For Kids
619 Yellowed Yak
620 Frantic Fox
( Items: 601 - 620 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;
}