Id Name Status Action
901 Zany Zebra
902 Jamaican Walrus Corps
903 Outrageous Osprey
904 Better Boar
905 Disgusted Dunlin
906 Disgusted Dingo
907 Cheerful Cormorant
908 Trendy Bubble Camp
909 Sinister Fighter Romp
910 Ugliest Unicorn
911 Grumpy Gerbil
912 Fatal Kitchen Master
913 Ugliest Unicorn
914 Bizarro Spork Melee
915 Quaint Quetzal
916 Good Guanaco
917 Italian Burger in Vegas
918 Fruity Chase Quiz
919 Pleasant Penguin
920 Telekinetic Hillbilly Odyssey
( Items: 901 - 920 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;
}