Id Name Status Action
981 Dwarven Bomberman Showdown
982 Sleepy Stoat
983 Busy Buzzard
984 Calm Caterpillar
985 M.C. Escher Bass Thieves
986 My Little Punching vs. The Space Mutants
987 The Muppets Computer EX
988 Rad Bandicoot on Wheels
989 God of Ninja Spree
990 Filthy Fly
991 Anxious Anteater
992 Infinite Biplane in the Desert
993 Smiling Seahorse
994 Brave Beetle
995 Testy Tern
996 Modern Moth
997 Faithful Ferret
998 Helpless Hawk
999 Enraged Internet Base
1 000 Wide-eyed Warbler
( Items: 981 - 1000 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;
}