Filter Expression on Download List
Two part question:
#1 - I have a download list on a page that displays pdf documents from a Documents and Files library. Is there a way to dynamically update the filter expression on the Download List based on a click event by a user? The reason I ask is I have an A - B - C listing and when users click on the letter "A" only the pdf's that begin with the letter "A" should be displayed. When they click on the letter "B", only the documents that begin with "B" are displayed and so forth.
#2 - On the filter expression of the download list what should I add to return documents begining with a letter? Is there a Title.BeginsWith("A")? I have seen and used Title.Contains("A"), but that just returns all documents that have an "A" in their name.
Thanks.
Thanks.
Update:
#2 - So using Title.StartsWith("A") and adding it to the FilterExpression property of the Document List lists only the documents that begin with the letter passed, in this case the letter A.
Back to #1 - How do I pass the letter I want to filter by to the document list? Should I just build 20+ pages for each letter of the alphabet? Not wanting to go this route of course. Any suggestions?
Hi Reynaldo,
In order to achieve your needs you need to update the WidgetTemplate.
You could list all the documents and implement some JavaScript logic to hide the files you do not need on the page. This is under: Download List widget > Edit menu > Settings > Edit thumbnail list template.
Add a TextBox and a Button on the template for example and adding at the end your JavaScript logic:
<script type=
"text/javascript"
>
// implement your logic here
</script>
Thanks for the reply Svetoslav.
The first option we have already implemented and hide/display documents based on user click of a link with CSS and JS. The caveat to that was that it would only filter the documents on the current page and our client has 800+ documents that we are filtering thru. So displaying them all on one page was not to their liking and paging was requested to list the documents. I'll look at your alternate solution and see if I may go that route.
Thanks for your help!
Hello Reynaldo,
Thank you for your feedback.
Please do not hesitate to get back to me if any problems persist, I'll be glad to assist you further.
Regards,
Svetoslav Manchev
Telerik