Id Name Status Action
801 Strange Seahorse
802 Battle Buddhist Massacre
803 Adventurous Angelfish
804 Viking Cricket Extra
805 Lair of the Gun Championship
806 Tropical Catapult Strikes Back
807 Shiny Salamander
808 Unsightly Unicorn
809 Disturbed Dingo
810 Tense Thrush
811 Arcane Jetpack Frenzy
812 Xerothermic Xenomorph
813 Alive Anteater
814 Bonk Spatula in Vegas
815 Light Llama
816 Average Anaconda
817 Dance Dance Night City
818 Jolly Jellyfish
819 Energetic Elk
820 Atomic Carnival X
( Items: 801 - 820 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;
}