sjtuross 9 Posted August 13, 2024 Posted August 13, 2024 Hello, I derived my plugin option class from EditableOptionsBase. Any enum property decorated by this attribute EditMultilSelect is rendered as a multi-select drop-down list. My intention is to leverage this UI control for user to multi-select media libraries. The help I need is that - Besides enum, what other types are supported by EditMultilSelect? Even if it allows multi-selection, it seems only one value can be saved. Is there a way to save all the selected values? Thanks! @softworkz
Solution softworkz 5066 Posted August 14, 2024 Solution Posted August 14, 2024 18 hours ago, sjtuross said: EditMultilSelect is rendered as a multi-select drop-down list. This is a design decision made by Luke. My opinion about that is two-fold: I think it's good to have multi-select drop-downs, because in certain cases this is a better choice But I dislike that it is forced upon all multi-selection controls without being able to show a select list directly, because there are other cases where this is a much better choice There are two way to work around this shortcoming: 1. Multiselect without checkboxes You can see this in the "Plugin UI Demo" plugin: You can achieve this by adding the Emby SDK Reference: EditMultilineAttribute to the property. This actually SHOULD turn the multi-select dropdown into a plain multi-select with checkboxes, but as long as the underlying Emby UI doesn't support that, it goes a sideway which works but without checkboxes and users need to use SHIFT-CLICK and CTRL-CLICK to select multiple items. This attribute also turns a single-select dropdown into a single-select listbox. 2. Grid Control This is what is being used for example in the Transcoding Test plugin for the wizard selections. It's undocumented, but I might be able to provide a sample for using it. 18 hours ago, sjtuross said: The help I need is that - Besides enum, what other types are supported by EditMultilSelect? Even if it allows multi-selection, it seems only one value can be saved. Is there a way to save all the selected values? An Emby SDK Reference: EditMultilSelectAttribute, should be applied to a string property with the value being a comma-separated list of item values. The items source items must be another property (Browsable-False) which carries an IEnumerable of Emby SDK Reference: EditorSelectOption (defining the values and display strings). Finally, you apply this list to the multi-select property with the Emby SDK Reference: SelectItemsSourceAttribute. You can find examples for this in the file SelectionUI.cs in the Plugin UI Demo example. Hope this helps, sw 1
sjtuross 9 Posted August 16, 2024 Author Posted August 16, 2024 This is extremely helpful. I finally picked the MultiEnumSelect example in SelectionUI.cs and got my library multi-selection drop-down implemented. It looks pretty cool. Thank you!! 1
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now