Brenden Kehren
-
6/14/2012 12:45:51 PM
Custom Filter and Document
I've created a custom filter and it works great although I need to set the OrderBy on the DocumentType that I created. The problem I'm having is the filter gathers data from a webservice and then sets the WhereCondition in code but when it comes to sorting the results the field I need to sort by is not available in the Document Type because it changes with each search.
For instance, the document type I created is MyLocations which has a number of attributes (name, address, city, state, etc). These documents are deleted and reimported into Kentico using the Scheduler and a custom module once per day. At when the user goes to search for a location and enters a city, selects a state and selects a distance away (10 miles, 20 miles, etc) they are returned with results. I have web services that determine how far a location is from that city and state they have entered but need to sort by that distance (shortest first) and show the distance on the page.
|