Id Name Status Action
721 Depressed Dragonfly
722 International Shock - The Card Game
723 Prickly Pollan
724 Amphibious Shopping Summit
725 Creepy Cheetah
726 The Great Katana Starring Mickey Mouse
727 Arrogant Addax
728 Mystic Chef Encounter
729 Clumsy Caterpillar
730 Madden Samurai Marines
731 Stormy Sandpiper
732 Sim Worm vs. Street Fighter
733 Bizarre Insect Struggle
734 Nutty Newt
735 Confused Crab
736 Bonk Bong in Middle-Earth
737 Presidential Square Dancing Simulator
738 Jewish Prison Desperadoes
739 Black Bug
740 Inexpensive Impala
( Items: 721 - 740 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;
}