0

How can I inlcude buttons in OpenDialogCommand?

$options = [
        'dialogClass' => 'my-dialog-class',
        'width' => '700px',         
        'buttons' => [
          'text' => 'Continue',
          'class' => 'btn-primary ok-button',
          'click'=> "function() { $(this).dialog('close'); }",
  ],
      ];

      $response->addCommand(new OpenModalDialogCommand($title, $content, $options));

This seems not to work. The class is set, but no buttons are shown.

0

In the $options array the element "buttons" must be a "multiple" array. For example:

$options = [
  'dialogClass' => 'my-dialog-class',
  'width' => '700px',
  'buttons' => [
    [
      'text' => 'Continue #1',
      'class' => 'btn-primary ok-button',
      'click' => "function() { $(this).dialog('close'); }",
    ],
    [
      'text' => 'Continue #2',
      'class' => 'btn-primary ok-button',
      'click' => "function() { $(this).dialog('close'); }",
    ],
  ],
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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