Id Name Status Action
941 Jack Thompson Hang Glider Sisters
942 Jolly Jackal
943 Bad Bat
944 Real Rook
945 Ingenious Programming Domination
946 Musical Paintball Punishment
947 Japanese Boxing Knights
948 Distinct Dormouse
949 Upset Unicorn
950 Testy Tapir
951 Final Sunshine Dash
952 Innocent Impala
953 Puzzled Penguin
954 Fair Falcon
955 Jolly Jellyfish
956 Famous Fly
957 Tender Tarsier
958 Gentle Goosander
959 The Last Karaoke from Mars
960 Unsightly Unicorn
( Items: 941 - 960 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;
}