Id Name Status Action
201 Crazy Copperhead
202 Smiling Shark
203 Amused Ape
204 Concerned Cow
205 Worrisome Wren
206 Romantic Chocobo Preacher
207 Inappropriate Pinball - The Gathering Storm
208 World of Graveyard Explosion
209 Revenge of the Math Saloon
210 Search for the Bowling Slaughter
211 Bewildering Amish Train
212 Thoughtless Thrush
213 Atomic STD Rush
214 Virtua Architecture Squadron
215 Wicked Wasp
216 Vast Vulture
217 Yucky Yak
218 Hindu Wheelchair City
219 Foolish Fly
220 Homely Hornet
( Items: 201 - 220 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;
}