I've tried looking on the web for a reasonable way to implement a website that contains a list of items which should be filterable on all its data and return the result asynchronous. Let's say the item has 3 properties, where each property can be some value. The idea is then that I have 3 buttons, each button representing a property, with a dropdown list of the possible values as such:
Lets say I come to the page with no filtering applied. And then I click on the color button and select yellow. Then I would get a result of yellow with all shapes and heights. And if I then click on shape and select circle, I would get a yellow circle with all heights, etc...
I'm currently programming in asp.net mvc5 and I can't seem to find any obvious solution to this problem.
To me it looks like the "default" solution there is to make a synchronous GET request to an Action which would set an url on all the values with any previous filter parameters. For example; let's say the action's name is ShowItems, and I enter the site. The red value would be an anchor with href="/ShowItems?color=red". I then press red and I get the result. The circle value would now have an url of "ShowItems?color=red&shape=circle, square would have "ShowItems?color=red&shape=square, 10 cm would have "ShowItems?color=red&height=10cm, etc...
Am I wrong to assume that? I don't really know where to go from here. I really don't like the idea of having to load the page for each filter click. But I'm having a hard time finding a good example for what I'm looking for.
Aucun commentaire:
Enregistrer un commentaire