Id Name Status Action
621 Dark Dormouse
622 Naughty Newt
623 Terrible Tuatara
624 Easy Emu
625 Electric Mummy Epidemic
626 Different Dugong
627 Agreeable Alligator
628 Unpleasant Caveman XP
629 Wrong Walrus
630 Arrogant Albatross
631 Barbie Barcode in the Salad Kingdom
632 Anxious Anteater
633 Subatomic Shopping Palace
634 Nighttime Puppy - The Revenge
635 Adventurous Addax
636 Outrageous Oyster
637 Nudist City Man
638 Aggressive Alpaca
639 Elite Llama Tycoon
640 Weary Wren
( Items: 621 - 640 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;
}