- πΈπ°Slovakia coaston
Hi Captain,
is in it duplicate of 3285499 β¨ Options to automatically select/deselect ancestors/descendants when node is checked/unchecked. Needs review ?
Hi,
first of all thank you for that great module :)
It is clear that it cannot (and maybe should not) provide everything everybody needs out of the box.
However it would be great, if one could customize
The jstree settings:
// Build the tree.
treeContainer.jstree({
core: {
data: {
...
plugins: ["search", "changed", "checkbox", "conditionalselect"]
i.e. via drupalSettings and a hook. In my case i want to add the "wholerow" plugin for simpler selection. From all I know it is not possible to modify jstree settings afterwards, see
https://github.com/vakata/jstree/issues/1291
So my only option at the moment seems to be a patch for the module.
Modify the parent of an entity via "hook_entity_reference_tree_create_term_node_alter":
This is currently not possible since the parent variable in "createTreeNode" cannot be changed via hook:
public function createTreeNode($entity, array $selected = []) {
$parent = $entity->parents[0];
$text = $entity->name;
\Drupal::moduleHandler()->alter('entity_reference_tree_create_term_node', $text, $entity);
if ($parent === '0') {
$parent = '#';
}
Even if I change the parent in the $entity variable - which is passed by reference - the if condition for the fixed parent variable gives me no chance.
To fix that I currently use a decorator, which is not that nice.
Active
2.0
Code
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
Hi Captain,
is in it duplicate of 3285499 β¨ Options to automatically select/deselect ancestors/descendants when node is checked/unchecked. Needs review ?