I can add a form to an Admin page using the code below in a Block:
$form = $this->formFactory->create();
$this->setForm($form);
$item = $this->registry->registry('current_item');
$fieldset = $form->addFieldset('score_fieldset', ['legend' => __('Stuff')]);
if ($item->getId()) {
$fieldset->addField('item_id', 'hidden', [
'name' => 'item_id',
'value' => $item->getId(),
]);
}
$fieldset->addField('entries_num', 'text', [
'label' => __('Number of Entries'),
'name' => 'entries_num',
'value' => $item->getEntriesNum(),
]);
$fieldset->addField('score', 'text', [
'label' => __('Score'),
'name' => 'score',
'value' => round($item->getScore(), 1),
]);
return parent::_prepareForm();
}
However, I would like to add the form as an editable grid of all the scores/entries. Is this possible?