Id Name Status Action
321 Zealous Zebra
322 Real Raccoon
323 Fiery Equestrian - The Revenge
324 Bad Barracuda
325 Jedi Rabbit Brothers
326 Invisible Driving Caper
327 Stormy Spider
328 Courageous Crocodile
329 Clumsy Crossbill
330 Colorful Chipmunk
331 Sonic Castlevania Championship
332 Light Ladybird
333 Inexpensive Ibex
334 Perfect Panda
335 Depressed Duck
336 Irish Motorcycle Uprising
337 Curious Crossbill
338 Agreeable Ant
339 Enchanting Eagle
340 Plain Peafowl
( Items: 321 - 340 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;
}