Id Name Status Action
61 Blocky Octopus Horde
62 Little Hang Glider Tournament
63 Fine Flatworm
64 Underground Chess Feud
65 Irritating Blood of the Deep
66 Dangerous Buddhist in the Salad Kingdom
67 Terrible Teira
68 Mexican Hair Salon in the Hood
69 Depressed Dogfish
70 First-Person Snowboard Rider
71 Underwater Shopping Football
72 Glamorous Gemsbok
73 New Bow Hunter Thieves
74 Nuclear Dating Special Edition
75 Awesome Mummy Annihilation
76 Irresistible Fire Psychiatrist
77 Ill Iguana
78 Wide-eyed Walrus
79 Grumpy Goldfinch
80 Helpful Hippopotamus
( Items: 61 - 80 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;
}