Id Name Status Action
741 Unpleasant Fencing Epidemic
742 Space Music Underworld
743 Day of the Chase Strikes Again
744 Screaming Lawnmower School
745 Worried Wryneck
746 Victorious Vicuña
747 Third-World Dog Smash
748 Aero Outlaw of Mystery
749 Street STD Summit
750 Happy Batman Roundup
751 Perfect Piranha
752 Colorful Constrictor
753 Hurt Hedgehog
754 Shameful Sunshine III
755 Unusual Unicorn
756 Thankful Tern
757 Fruity Acid Revisited
758 Talented Teira
759 My Very Own Army Forever
760 Vast Vicuña
( Items: 741 - 760 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;
}