// Add on defined fields, noting that they're prefixed with the field name.
$form['group_columns'
] =
[ '#type' => 'checkboxes',
'#title' =>
$this->
t('Group columns (additional)'
),
'#default_value' =>
$this->options
['group_columns'
],
'#description' =>
$this->
t('Select any additional columns of this field to include in the query and to group on.'
),
'#options' =>
$options +
$group_columns,
];
} public function submitGroupByForm(&
$form, FormStateInterface
$form_state) { parent::
submitGroupByForm($form,
$form_state);
$item = &
$form_state->
get('handler'
)->options;
// Add settings for "field API" fields.
$item['group_column'
] =
$form_state->
getValue(['options', 'group_column'
]);
$item['group_columns'
] =
array_filter($form_state->
getValue(['options', 'group_columns'
]));
} /**
* Render all items in this field together.
*
* When using advanced render, each possible item in the list is rendered
* individually. Then the items are all pasted together.
*/