HTML5 Data Bindings Formatter Support Product Page

Answered

List of Users -- Display only names that begin with selected letter

Asked 23 Oct 2014 04:47:05
1
has this question
23 Oct 2014 04:47:05 Joe Villanova posted:
I have a long list of users and I want the page to display only the users whose name begins with "L" for example -- when I click on a text link (I'll have a list of text links A thur Z so that someone can search for each letter).
The default view of the page will be ALL the users, paginated in groups of 10.
At the top of the page will be the letters A, B, C, etc that someone could click on and the view will change to just those users.

Replies

Replied 25 Oct 2014 02:21:25
25 Oct 2014 02:21:25 Joe Villanova replied:
Figured it out. Set the database to filter user name with Starts With, Form Variable and Letter (the name of the form field). Create a null link for each letter, A, B, C, etc. Add a behavior to Control Bindings, send the value of the letter to the database. This may not be a perfect solution, but it seems to work.
Replied 25 Oct 2014 03:16:06
25 Oct 2014 03:16:06 Joe Villanova replied:
Spoke too soon. Solution doesn't work all the time.
Replied 27 Oct 2014 10:47:47
27 Oct 2014 10:47:47 Teodor Kuduschiev replied:
Hi Joe,
Unfortunately there is no way to directly filter the results using a button/link and behaviors.
What i can recommend is - create a hidden field and use its value as a filter for your data source. Write some custom code that changes its value, when a letter is clicked.
OR use a dropdown menu with the letters inside to filter the results.
Replied 27 Oct 2014 14:43:31
27 Oct 2014 14:43:31 Joe Villanova replied:
I got this far: hudsonchildrensbookfestival.com/DEV/testdata.php

But the only problem is if someone hits Next page, the sorting only takes place on the names that appear on the next batch. For example, if you page forward to where no names with A begin and then press the A link, no results are shown. Somehow I need to refresh the database before each time a letter link is pressed?
Replied 27 Oct 2014 17:28:22
27 Oct 2014 17:28:22 Joe Villanova replied:
I think I might have it working. Not sure how I did it though.
Replied 27 Oct 2014 17:31:19
27 Oct 2014 17:31:19 Joe Villanova replied:
ugh. no still have the issue if you page to any of the pages, the A link doesn't bring up sorting -- it doesn't see the entire database, is sees just what is shown.

Reply to this topic