I am having issues opening a modal with buttons using OpenModalDialogCommand
.
It says in the docs of that command, that it can take as it's 3rd param any Jquery UI option (from http://api.jqueryui.com/dialog/) and it works well, for width/height/class, but anything more advanced i hit a wall. I am trying to make a button but can't figure it out.
$response = new AjaxResponse();
$options = [
'width' => '800',
'height' => '300',
'dialogClass' => 'no-close',
'buttons' => [
'text' => 'Proceed',
'click' => 'function() {alert();}'
]
];
$response->addCommand(new OpenModalDialogCommand('Title', 'Body', $options));
return $response;
This returns a modal successfully, width is ok, height is ok, class is ok, but there is not button, i tried 3/4 variations of it with no luck.
~p.s. i know i can make a simple form with one button, and return that in the modal, but there has got to be a way to make this work.