Id Name Status Action
141 Silent Harpoon Saloon
142 Adventurous Aardvark
143 Disney Bingo - The Dark Project
144 Unsightly Unicorn
145 Prickly Parrot
146 Colorful Corncrake
147 Distinguished Bungie in the Middle East
148 Sinister Banana Interactive
149 Shrunken Dentist Preacher
150 Everybody Hates the Dungeon Massacre
151 Enchanting Eland
152 Obedient Ostrich
153 Surprise Afro Palace
154 Homeless Hedgehog
155 Unforgettable Bazooka Revisited
156 Better Badger
157 Religious Trailer Park EX
158 Quiet Cyborg Smash
159 Crazy Capuchin
160 Fragile Flamingo
( Items: 141 - 160 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;
}