0

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?

1 Answer 1

0

Visit this link for creating admin grid

Create admin grid in Magento 2

And for Inline edit content

Inline Edit Component

1
  • Thanks, but I'm asking if it's possible without using an xml file. Commented Oct 16, 2017 at 21:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.