Hi @Manuel Garcia,
Yes, I noticed the todo comments w.r.t multiple grouping inside the plugin file.
Agreed with the conditional adding of wrapping div. However, i noticed that this.usegrouping
is always true for both single and multiple grouping.
Reference- Check below code in public function preRender($result)
$view_settings['usegroupheader'] = FALSE;
foreach ($this->options['grouping'] as $group) {
$view_settings['usegroupheader'] = $group['use-grouping-header'] == 1;
// @TODO handle multiple grouping.
break;
}
The above piece of code makes the 'usegroupheader' as always TRUE, because of which the div tags from JS gets added every time.
Yes, I came across this issue when porting the views_nested_Accordion
module to D8. A little bit about that module:
- It's a module that provides one level of nesting/grouping.
- To acheive its purpose, This module extends the viewsaccordion plugin and add's some configuration.
- For rest of functionality it has it's own JS which sort of adds classes & does accordion things using jQuery functions.
So during my porting exercise, I noticed that the 'div' getting added from JS was causing an issue.
Please let me know what do you think.
Also for reference: Here is the issue regarding the D8 port of views nested accordion: https://www.drupal.org/node/2893497