Multiple lines per row but search as one
Multiple lines per row but search as one
Hi,
I have a situation where I need to show two or more rows as a unit of data. For example, I might want to show two products that can go together to make a unit. Suppose I was looking for things that could be made into a sandwich. My results might show:
Food | Calories | Price | |
---|---|---|---|
1. | Bread | 200 | 0.25 |
Peanut Butter | 150 | 0.10 | |
2. | Bread | 200 | 0.25 |
Peanut Butter | 150 | 0.10 | |
Jelly | 75 | 0.10 | |
3. | Bread | 200 | 0.25 |
Roast Beef | 250 | 1.00 | |
OK, here's the challenge. I need to be able to filter and sort them by:
a) All combinations containing an ingredient.
b) Total calories.
c) Total cost.
I was thinking that I could use a nested table for this with some hidden columns that have the totals and other information (like a comma delimited list of the descriptions) and filter/sort on those. I was planning on using YADCF for the sorting.
Any ideas if this is feasible? If my approach is wrong, is there another way to accomplish this with datatables and something like YADCF?
Thanks