-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature Request: How can we filter out certain options making them disappear from the UI? #7
Comments
Hi @Reinhard-S , p.s. I will try to ping Microsoft again on this. |
Hi @BetimBeja, thanks for your quick reply and for this nice control! :) Good to know, that there is an option available through form-API! Sadly, it requires a work-around. What's your opinion on the use case above? Wouldn't it make sense to add a filter property to your control, independent on the MS-API-bug, so items could be hidden by non-developers without additional form scripting? As described, I'd suggest two additional properties:
I guess, this would greatly improve functionality and helps implementing requirements without user-specific code. Kind Regards, |
Your use case makes sense 😄 And I like how detailed your feature request is... I will see what I can do tomorrow. Hopefully, I can share some recording of the dev process for the benefit of the community. |
Hey @Reinhard-S, |
Hello @BetimBeja, |
I am trying to show how much Storybooks help in developing PCF Components. Also, help a lot with feedback from all stakeholders 😉 |
@Reinhard-S if the latest release is good enough for you, you can close this issue 😄 |
Hello @BetimBeja, first of all I'd like to thank you for the quick implementation, it works like a charm but initially I didn't really understand why you specified 3 as the group. I was really lost, because I thought of the "group" as being defined by the related choice items currently selected. The value of 3 therefore really confused me as the group of items should in my eyes be defined by all values where the first 6 digits match. I guess it's just a misunderstanding, nevertheless, cutting the last three digits of each number by comparing the quotient of your 10n-division is really smart! :-) I'm not sure if my view on things is more valid than yours but may I suggest to slightly change the formula so it's really possible to assign a group-size of 6 digits instead of the item-size? How about e.g.?: let number = 100200300;
let groupSize = 6;
let groupId = Math.round(num / Math.pow(10, Math.floor(Math.log10(num)) - n + 1)); // groupId = 100200 Regarding your comment "ex. doing tests I realized that I didn't fix the following: Clearing selected options when the parent filter excludes those options." I also got a note / question for you: We may place two of your controls pointing to the same field in order to separate the selectable options through two dedicated tabs (one containing all infos for Marvel, the other for DC Universe) but in this case options displayed by both controls would need to persist and being merged. I found your feature "Banished Choices" really useful for this (thanks for adding it!), but in this use-case values being banished should be kept untouched in the value of the control. Maybe you could foresee a configuration switch to control if banished values should be ignored or removed from the currently selected values? Thank you very much! Kind Regards, |
Hi @Reinhard-S, Regarding the behavior of removing the currently selected values, I think I can exclude the logic which removes the currently selected values if those are in the banished choices 😄 |
Thanks for the insights - in this case I'd treat it as a documentation challenge for you. 😄 BTW, I missed the option to add static values in the Related Choices field, could you please enable this? This would allow me to put a static filter on groups which is quite handy for other use-cases. Finally, I really like the test platform implementation you did with storybook. Do you happen to have a blog post on how you integrate it? I spent some time cloning your repo, used npm to get all dependencies and storybook installed and tried to get the debugger working when instantiating the control through storybook. Unfortunately, I was not able to get things right and my breakpoints were not hit. Would love to get some additional insights on your dev process, do you use VS Code, full blown Visual Studio (which i have to admit that I prefer) or do you use a different kind of tool to debug your code? Thanks, |
I will publish a blog post soon on how to easily setup the tests with storybook. I am using VS Code as it is best suited for Front-End development in my opinion (because of different extensions). I will add the static filter also... I added banished choices as a complementary feature 😄 |
@Reinhard-S I added the Static Choices parameter if you want to play with it in the Storybook Will publish the new version soon. |
Hi @Reinhard-S , Do you have any other suggestion/request or can I close this issue? |
Hi @BetimBeja, thank you very much once again, I'll use your implementation as you published it. Kind Regards, |
Great Job, Thanks! 👍 |
Hello,
Is it possible to filter out certain options making those switches disappear from the UI?
If not, may I ask for a feature providing an option to filter certain options out, hiding them completely (comma-separated values of a multi-option set column or a JSON array of values)?
Perfect solution for one of our current use-cases would be to allow to bind a second multi-option set column to your control (foreign field on the current record) which then acts as a filter on the option values currently being displayed on the UI.
The idea is to implement a dependent multi-option set field, enabling users to select a parent classification and to solely allow selection of matching values.
E.g.: Let's assume we want to classify heroes and therefore have a universe field on our contact form (multi-option set) as well as a category field (also multi-options set). We would like to store the classification of a contact person which represents a hero in our example:
Chat-GPT helped me providing a possible classification matrix of heroes:
E.g.: If Marvel is selected, only Mutant, Avenger or Sorcerer is available as Category.
Do you think something like this is possible?
Thank you,
Cheers,
Reinhard
The text was updated successfully, but these errors were encountered: