Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • David Peck 687 posts 1863 karma points c-trib
    Mar 29, 2023 @ 18:44
    David Peck
    0

    Is it possible to have a filter set with options from the DB

    https://docs.getkonstrukt.net/filtering/filterable-properties#defining-filterable-properties

    I have an entity called resources, which has a many-to-many relationship with another entity called topics. The resources collection uses the entity picker to select the topics that it is related to.

    I would like to have a topics filter setup for the resources collection (User story: As a user I want to see a list of all the topics in the resource filters, and selecting a topic filter reduces the list of resources shown to only those that are related to the topic).

    Is this possible using filters, without hard coding the list of topics?

    I can only think to loop through the topics in the configurator calling filterConfig.AddOption("Option1", "Option One", (val) => val != "Option Two"); for each. However I assume any new topics won't appear until the application is restarted.

  • Matt Brailsford 4124 posts 22215 karma points MVP 9x c-trib
    Mar 30, 2023 @ 08:30
    Matt Brailsford
    0

    Hey David,

    Hmm, yea it looks like we expect the options to be known at startup.

    I guess we could do with an OptionsBuilder similar to how we have a DataViewsBuilder (https://docs.getkonstrukt.net/filtering/data-views/data-views-builders) to allow them to be created at runtime. 🤔

  • Matt Brailsford 4124 posts 22215 karma points MVP 9x c-trib
    Mar 30, 2023 @ 09:39
    Matt Brailsford
    100

    Hey David,

    I've implemented an KonstruktFilterOptionsBuilder<TValueType> base class that should allow you to create a dynamic options list. There is now a new bunch of SetOptionsBuilder methods on the filter to allow you to assign one.

    If you use the Typed arg version, it will use DI to resolve the type so you could implement your own GetOptions implementation to look up the options how you see fit.

    You can find a beta build on our unstable feed at https://nuget.outfield.digital/unstable/v3/index.json (v1.6.5-beta0007)

    If you want to give this a try and see if it gives you what you need, that would be super

  • David Peck 687 posts 1863 karma points c-trib
    Mar 30, 2023 @ 12:31
    David Peck
    0

    Superb. Will do.

  • David Peck 687 posts 1863 karma points c-trib
    Apr 06, 2023 @ 12:46
    David Peck
    1

    Hi Matt. Sorry not to have actioned this. The question was part of scoping, and I've not been able to carve out some time to investigate further. To make matters worse I'm off next week. I'll look at this as soon as I can on my return.

  • Matt Brailsford 4124 posts 22215 karma points MVP 9x c-trib
    Apr 06, 2023 @ 12:49
    Matt Brailsford
    0

    No worries 👍

  • David Peck 687 posts 1863 karma points c-trib
    Jun 09, 2023 @ 11:22
    David Peck
    0

    Hi Matt,

    I'm sorry to have taken to long to get back to this. It's been on the project backlog, and I've not been able to get the time to look at this.

    The good news is that I've implemented this successfully! Yay! Thanks for creating this feature.

    I nearly came back to you a bunch of times claiming an issue, but each time I realised that it was a complexity in that my property is of type ICollection<MyEntity>. I got it working fine though, and I can find no issues.

    What possibility is there that this will become part of a public release?

  • Matt Brailsford 4124 posts 22215 karma points MVP 9x c-trib
    Jun 09, 2023 @ 11:55
    Matt Brailsford
    1

    Hey David,

    Glad it does the trick.

    I’ll take a look after CG about getting a new release out 👍🏻

  • David Peck 687 posts 1863 karma points c-trib
    Jun 09, 2023 @ 11:59
    David Peck
    0

    Wonderful. Thank you.

    I didn't know if you still had to fit in with more complex release cycles post acquisition. I'm glad to hear that it's business as usual.

    Enjoy CG!

  • Matt Brailsford 4124 posts 22215 karma points MVP 9x c-trib
    Jun 09, 2023 @ 12:42
    Matt Brailsford
    0

    Until it's re-branded it's business as usual 👍

  • David Peck 687 posts 1863 karma points c-trib
    Jul 11, 2023 @ 12:29
    David Peck
    0

    Do you have a clearer idea when the next non-beta release with this solution might be released, by any chance?

  • Matt Brailsford 4124 posts 22215 karma points MVP 9x c-trib
    Jul 11, 2023 @ 14:13
    Matt Brailsford
    0

    Hey David,

    There is a Konstrukt issue I need to get to which I'll try and schedule this week. Once i've had a look at that, I can get an update pushed out.

    Apologies for the delay.

  • David Peck 687 posts 1863 karma points c-trib
    Jul 11, 2023 @ 14:32
    David Peck
    0

    Fab. No apologies necessary. Just checking the timescale.

Please Sign in or register to post replies

Write your reply to:

Draft