I am trying to recreate a list from a grid and am having trouble replicating a search functionality I had set up with the grid's logical controls, which worked like a charm in the grid. The grid contains clients who have some combination of four products: A, B, C, and D. Some clients have all four, some have one or two, and when a logical checkbox is selected for a product in the search part, only the clients who have that product remain in the grid. So, if you check A, everyone who has A is in the grid. If you check A and B, clients who have both A and B are in the grid (but, importantly, not clients who ONLY have A and B). Likewise, when you uncheck a product, it removes that particular filter, but leaves the rest. There is also a dropdown filter for geographic counties that could further filter the grid. Pretty basic stuff.
The grid is linked to a SQL table where each product is defined with a bit field, true for yes and false for no. The following fires in an onChange event in the grid's search part for each logical field:
I am able to recreate this filter for a list when checking one of the logical checkbox filters, however, when I do multiple checks, or when I uncheck my logical checkboxes filters for the list, it works incorrectly. When unchecking, it filters the list so that it displays only clients who do not have the product. So, if I had checked A and B, then uncheck A, rather than displaying all clients who have B (but also might have other products), it displays clients who only have B and no other products at all. Likewise, it does not incorporate the dropdown county filter properly, only when used by itself to filter the list.
The way I have set this up right now is by creating a unique Javascript Action for each checkbox (and the dropdown) called filter_A, filter_B, etc. which runs the action javascript 'Filter Records in a List Control' that only filters the one dialog and its corresponding field with search option 1. This action is set to run onChange.
2020-03-07_20-00-43.png
I have also tried combining the javascript actions into one 'Filter Records in a List Control' action and tying it all to an onClick event for a Filter button, but it doesn't help.
I have also tried the built-in list search option, but that has an issue where if I check product A, it will yield results with customers who have ONLY product A, not all customers who have product A. Changing the list's 'multiple search criteria' from AND to OR does not fix it, but rather yields no results from the checkboxes.
I am sure this is a fairly simple thing to fix but I can't quite grasp how. Thanks in advance for any assistance on this lengthy post.
The grid is linked to a SQL table where each product is defined with a bit field, true for yes and false for no. The following fires in an onChange event in the grid's search part for each logical field:
Code:
{grid.Object}.submitSearchForm();
The way I have set this up right now is by creating a unique Javascript Action for each checkbox (and the dropdown) called filter_A, filter_B, etc. which runs the action javascript 'Filter Records in a List Control' that only filters the one dialog and its corresponding field with search option 1. This action is set to run onChange.
2020-03-07_20-00-43.png
I have also tried combining the javascript actions into one 'Filter Records in a List Control' action and tying it all to an onClick event for a Filter button, but it doesn't help.
I have also tried the built-in list search option, but that has an issue where if I check product A, it will yield results with customers who have ONLY product A, not all customers who have product A. Changing the list's 'multiple search criteria' from AND to OR does not fix it, but rather yields no results from the checkboxes.
I am sure this is a fairly simple thing to fix but I can't quite grasp how. Thanks in advance for any assistance on this lengthy post.
Comment