Id Name Status Action
181 Underwater Donkey Princess
182 Calm Chinchilla
183 Bloody Bug
184 8-Bit WWE World
185 Glorious Goosander
186 Prickly Pigeon
187 Arrogant Alpaca
188 Vast Vendace
189 Frail Fly
190 Shady Robot Inferno
191 Real Raccoon
192 Nasty Narwhal
193 Old-fashioned Oryx
194 Tired Thrush
195 Fisher Price Lego Romp
196 Misty Moose
197 Better Buffalo
198 Obnoxious Otter
199 Happy Hornet
200 Itchy Ibis
( Items: 181 - 200 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;
}