Id Name Status Action
541 Frail Finch
542 Magnificent Mamba
543 Itchy Impala
544 Exquisite Furry Online
545 Defiant Deer
546 Final Arcade in the Bayou
547 Brainy Beaver
548 Graceful Gorilla
549 Annoying Antelope
550 Inexpensive Iguana
551 Amazing Whale Brothers
552 Joyous Jackal
553 Thankful Tarantula
554 Insane Axe School
555 Arrogant Armadillo
556 Armored Skate Plus
557 Barbie Fighter Alpha
558 Odd Otter
559 Sparkling Snail
560 Defiant Dugong
( Items: 541 - 560 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;
}