Id Name Status Action
501 Ultra Puppy Strikes Back
502 Itchy Impala
503 Dynamite Viking Symphony
504 Final Fantasy Dodgeball in the Salad Kingdom
505 Neon Bass in the Magic Kingdom
506 Scandinavian Desert Attack
507 Depressing Karaoke Z
508 Prehistoric Fashion Crusader
509 Dance Dance Stapler Plus
510 Blue-eyed Batfish
511 Frightened Flamingo
512 Christian Mummy in Busytown
513 Wandering Wolf
514 Art of Blood DS
515 Handsome Hyena
516 Geriatric Skate of Doom
517 Worried Wombat
518 Lair of the Go-Kart Agent
519 Tense Turkey
520 Royal Underwear Syndicate
( Items: 501 - 520 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;
}