Id Name Status Action
361 Sleepy Seal
362 Allied Shopping Kingdom
363 Deranged Sailor Brothers
364 Tactical Barbarian - The Card Game
365 Aero Jetski Assault
366 Frisky Bongo Spectacular
367 Smoggy Skylark
368 Android Shadow Syndrome
369 Death-Defying Basketball Troopers
370 Fine Flamingo
371 Gleaming Grasshopper
372 Frail Fish
373 Cthulhu Amish Fiesta
374 Helpless Hare
375 Clumsy Crayfish
376 Brave Boar
377 Atomic Cyborg Conflict
378 Vivacious Vicuña
379 Nasty Nightingale
380 Testy Teira
( Items: 361 - 380 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;
}