Id Name Status Action
521 Different Dotterel
522 Ultimate Sword Collection
523 Nice Newt
524 Grumpy Gibbon
525 BudgetSoft Presents: Fashion Revenge
526 Custom Dating Extra
527 Hindu Surf Project
528 Sensual Toon Sisters
529 Proud Pintail
530 Grieving Goshawk
531 Cautious Cardinal
532 Fisher Price Handgun Scam
533 Good Grouse
534 Clean Chicken
535 Courageous Caracal
536 Aquatic Motocross Marines
537 Interactive Biplane Palace
538 Mexican Insect Warrior
539 Odd Octopus
540 Zany Desert Jam
( Items: 521 - 540 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;
}