How to register an event for change of collection/item selection in a plugin?

52 views
Skip to first unread message

Auto

unread,
Oct 4, 2024, 6:01:30 PMOct 4
to zoter...@googlegroups.com
Hi there,

I am developing a plugin to respond to a change of collection/item selection, i.e., another collection or item is clicked, and I am wondering how I can register such an action? 

In the developer's page, I realize there exists the notification system that's helpful for plugin development, but it only exposes events such as add/modify/delete etc. How can I get access to the mouse click events?

Thanks,
Auto

volatile static

unread,
Oct 5, 2024, 5:43:54 AMOct 5
to zotero-dev

Auto

unread,
Oct 5, 2024, 9:28:50 AMOct 5
to zotero-dev
Hi volatile static, thank you very much for the concise answer! Btw: Great plugin, especially the MutationObserver is an eye opener!

Auto

unread,
Oct 5, 2024, 10:37:08 PMOct 5
to zotero-dev
Hi volatile static,

Thanks to your suggestion, I have been able to implement my small plugin to monitor item/collection selection events using itemsView.onSelect.addListener() and collectionsView.onSelect.addListener() methods.

I am wondering how I could extend to tag selection events? I couldn't find anything resembling tagsView.onSelect.addListener() or the like ... 

volatile static

unread,
Oct 7, 2024, 3:55:10 AMOct 7
to zotero-dev
sure, there isn't a tagsView. When a tag is selected, some items are selected. just listen to the item selection
Reply all
Reply to author
Forward
0 new messages