Aug 9, 2011 2:19 PM
66 Posts

Filter Repeat Control by Value(s) in Column

  • Category: Server Side JavaScript
  • Platform: All
  • Release: 8.5.2
  • Role: Developer
  • Tags:
  • Replies: 3
 How would I filter a repeat control to only show documents with a certain value (e.g. a states 2 character abbreviation). What I would ultimately want to do is have a dropdown or button to select a state and it would refresh the page with the selected states.
 
Right now I have 3 (nested) repeats setup: 1. State, 2. Agent Code, 3. Agent Details. Everything is displaying properly, but I would like to filter certain states out. The outermost "State" repeat has the following code for data binding:
 
@Unique(@DbColumn(@DbName(), "AgentView", 3)) 
 
Where the number 3 is the  third column, Agent State, in the view. Is there a method I can use to only show documents with a certain state value in that column?
 
Thanks for any help. 
Aug 9, 2011 2:49 PM
64 Posts
Use @DbLookup instead of @DbColumn?
- Or use SSJS to run the entire state collection and presentation process instead of EL.  Should work either way ... check if a selection has been made, pull using that or pull it all.
 
Hope this helps...
Aug 12, 2011 4:03 AM
14 Posts
Re: Filter Repeat Control by Value(s) in Column
Use either @DbCollumn (no filter) or @DbLookup (key based on value in your combo).
 Another solution vould be to use single repeat with combination of "Keys" property of View data source.
Aug 12, 2011 8:14 AM
66 Posts
Re: Filter Repeat Control by Value(s) in Column
 Thanks for the replies. I was actually just able to filter the back-end view in the client so I didn't have to mess with filtering inside the repeat.