How to use selecting mode in k-item component

I love the additions to the k-item component! I’m currently trying to use the new selecting feature in a custom panel view, with a <k-collection> like this:

<k-collection :items="myItems" :value="mySelectedItems" layout="list" :selecting="true"/>

Can I somehow programmatically change the checked-status of the k-item? In my tests I couldn’t get it to work by changing the value (mySelectedItems), setting selected: true on individual items, or other approaches.

For my use case there might be hundreds of items so I need a way to trigger a “select all” or “unselect all”.

Thank you!

For now I’m using a workaround like this after programmatically changing the selection:

updateCheckboxes() {
  this.$nextTick(() => {
    this.$el.querySelectorAll('.k-collection input[type="checkbox"]').forEach((checkbox, index) => {
      checkbox.checked = this.selectedItems.includes(this.items[index]?.id);
    });
  });
}

It works quite well for shorter lists but feels a bit hacky, especially for larger collections.

I don’t think there is a better way currently. The select checkbox isn’t fed with any (external) value.

Thanks for the answer, Nico. Do you consider this a missing feature, something I should put on GitHub? Nolt?