You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the multiple prop is set to true, clicking on the options doesn't seem to do anything.
ExampleChildrenSelection.alink.vue
<scriptsetup>import { computed, ref} from'vue';constselectedParents=ref([]);constselectedChild=ref(undefined);constchildrenFilter=computed(() => {if (!selectedParents.value.length) {return []; }return [{ kind:'group', op:'AND', filter:selectedParents.value.map(selectedParent=> ({// This inner OR group shouldn't be needed, but there is a bug in how// multiple conditions against the same field are handled in Drupal Core// https://www.drupal.org/project/drupal/issues/3066202#comment-13181270 kind:'group', op:'OR', filter: [{ kind:'attribute', attribute:'parent.id', op:'=', value:selectedParent.id }] })) }];});</script>
<templatealink-route[com.example.farmos_asset_link.routes.v0.example_children_selection_page]="/select-parent-child">
<q-pagepaddingclass="text-left">
<h4class="q-mb-md q-mt-xs">Select parents and a child</h4>
<p><b>Parents:</b> {{ selectedParents.map(sp=>sp.attributes.drupal_internal__id+''+sp.attributes.name ) }}</p>
<p><b>Child:</b> {{ selectedChild?.attributes?.drupal_internal__id }} {{ selectedChild?.attributes?.name }}</p><entity-select
label="Parent Assets"
entity-type="asset"
v-model="selectedParents":multiple="true"></entity-select><entity-select
label="Child Asset"
entity-type="asset"
v-model="selectedChild":additional-filters="childrenFilter"></entity-select></q-page></template><script>import { h } from'vue';
import { QBtn } from'quasar';
exportdefault {
onLoad(handle, assetLink) {
handle.defineSlot('com.example.farmos_asset_link.tb_item.v0.example_children_selection_button', slot=> {
slot.type('toolbar-item');
slot.weight(20);
slot.component(() =>h(QBtn, { flat:true, dense:true, icon:"mdi-human-male-girl", to:'/select-parent-child' }));
});
}
}
</script>
EDIT: Updated script above to actually implement the multiple parent filtering "correctly" (i.e. in a way that works - albeit in a round-about manner).
The text was updated successfully, but these errors were encountered:
The
multiple
option to the EntitySelect component doesn't seem to be working...When the
multiple
prop is set totrue
, clicking on the options doesn't seem to do anything.ExampleChildrenSelection.alink.vue
EDIT: Updated script above to actually implement the multiple parent filtering "correctly" (i.e. in a way that works - albeit in a round-about manner).
The text was updated successfully, but these errors were encountered: