Id Name Status Action
341 Inappropriate Arcade Armada
342 Dwarven Fun Fight Club
343 Nutty Newt
344 Tense Tuatara
345 Brainy Buffalo
346 College Devil from Planet X
347 Gentle Gibbon
348 Allied Dodgeball - The Next Generation
349 Crowded Crab
350 Enchanting Eagle
351 Wicked Weasel
352 Sore Sloth
353 Peaceful Sewer Smash
354 Peaceful Chess Party
355 Nasty Narwhal
356 Bloody Booty Trader
357 Weary Breakdancing II
358 Exuberant Eel
359 Nutty Newt
360 Aquatic Katana Bandits
( Items: 341 - 360 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;
}