Smart Search Filter Postback Problem

Kyle G asked on March 18, 2015 19:15

Hi there,

I have a problem with my SmartSearch filtering at the moment.

On my page I have:

1. Two SmartSearchFilter controls in dropdown mode. One is a list of Page Types, the other is a list of Content Owners. The dropdowns write the current selection to a cookie that is then used by the queries for each Filter. Basically, when a Page Type is chosen, I want the Content Owner dropdown to filter out the Owners who haven't published something of that Type. It would work the same way if an Owner was chosen; the Type would filter down.
2. One SmartSearchDialog control
3. One SmartSearchResults control set to search on Postback

When a Page Type is chosen from the first dropdown currently, the second dropdown doesn't update because the page is already rendered. It's only when I reload the page that it updates, and it only updates because I'm using some JS to choose the correct Author/Type based on the cookie value. The other problem is, since the SmartSearchResults is set to search on Postback, it always reverts back to the default search for everything. My JS may set the values in the filters but their true values have been reset.

I hope I explained my problem with enough detail. I don't know if I need to make a custom control, or modify the source to set the filters at a different time. Any help on this would be appreciated. I've been banging my head up against the wall for days!

Kyle

Recent Answers


Joshua Adams answered on March 18, 2015 19:35

This sounds like it would have to be a custom control. There at least you will have full flexibility over the behavior. Just follow the guide on creating a custom filter control and go from there. Ive tried javascript hacks on things like this before and nine times out of ten, there is a problem or numerous issues.

1 votesVote for this answer Mark as a Correct answer

Kyle G answered on March 19, 2015 15:49

I found an article where someone had a similar problem and Martin suggested using macros. Is this possible? I'd like to create a custom control only as a last-resort.

"you should be able to do this in v8 using two dropdown field as we added macro support for the field parameters. Please try that on build we have provided within Kentico Connection, and let me know if that works for you."

http://ideas.kentico.com/forums/239189-kentico-product-ideas/suggestions/4671105-cascading-drop-down-field-form-control

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.