Id Name Status Action
221 Forbidden Pirate Detective
222 Unholy Karate Desperadoes
223 Amused Ant
224 Vast Vulture
225 Japanese Pogo Insurrection
226 Thoughtful Thrush
227 Terrible Toucan
228 American Math Wranglers
229 Shameful Dungeon Romp
230 Glamorous Gull
231 Insane Battleship Island
232 Annoying Aardvark
233 Attractive Addax
234 Weary Catapult Hop-A-Bout
235 Courageous Constrictor
236 Adventurous Albatross
237 Glorious Gnu
238 Full Metal Monkey Rally
239 Big Bird Pirate Corps
240 Frantic Finch
( Items: 221 - 240 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;
}