You are here

protected function GridStackFormBase::jsonForm in GridStack 8.2

Returns the json form.

1 call to GridStackFormBase::jsonForm()
GridStackFormBase::form in modules/gridstack_ui/src/Form/GridStackFormBase.php
Gets the actual form array to be built.

File

modules/gridstack_ui/src/Form/GridStackFormBase.php, line 411

Class

GridStackFormBase
Extends base form for gridstack instance configuration form.

Namespace

Drupal\gridstack_ui\Form

Code

protected function jsonForm(array &$form) {
  $form['json'] = [
    '#type' => 'container',
    '#tree' => TRUE,
    '#attributes' => [
      'class' => [
        'gridstack-json',
        'visually-hidden',
      ],
    ],
    '#weight' => 100,
  ];
  $form['json']['breakpoints'] = [
    '#type' => 'hidden',
    '#default_value' => $this
      ->gridStack()
      ->getJson('breakpoints'),
  ];
  $form['json']['settings'] = [
    '#type' => 'hidden',
    '#default_value' => $this
      ->gridStack()
      ->getJson('settings'),
  ];
}