0

Is that possible to create something like form and selection box in this popup?

right now I'm using this code to add custom button in my Plugin class, but I don't know how to add the customizable popup in the button

public function beforeSetLayout(\Magento\Sales\Block\Adminhtml\Order\View $view)
{
   $message = __('Are you sure you want to book Shipper?');

        $view->addButton(
            'book_shipper',
            [
                'label' => __('Book Shipper'),
                'class' => 'book-shipper',
                'onclick' => "confirmSetLocation('{$message}', '{$url}')"
            ]
        );
}

enter image description here

1 Answer 1

0

Try this

$this->addButton(
    'delete',
    [
        'label' => __('Delete Location'),
        'onclick' => 'deleteConfirm(' . json_encode(__('Are you sure you want to Delete This Location ?'))
            . ','
            . json_encode($this->getUrl('*/*/delete',['id'=> 12 ]))
            . ')',
        'class' => 'scalable delete',
        'level' => -1
    ]
);
2
  • I think your code doesn't have a code to creating a form or selection box isn't it?
    – Wavesolid
    Commented Jan 7, 2022 at 8:24
  • I update the answer please check it.
    – Msquare
    Commented Jan 7, 2022 at 12:16

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.