SearchPane for child table
SearchPane for child table

I have a parent/child setup as designed in the blog:
https://datatables.net/blog/2019-01-11
Is it possible to have a search pane at the top (I guess you would say at the parent level) but the searchpanel will have unique values from the child records and will show parent records that have child records for the selected searchpane element
So, using the blog example, lets say there is a SearchPane at the very top that lists all the last names that are found in the users table. Then, when you select a certain last name, it will show all locations that contain users with that last name. So if a Smith worked at both Edinburgh and London, those two site records would be the only ones to show.
I hope this makes sense.
This question has an accepted answers - jump to answer
Answers
For that particular example the
users
are part of the original data for the parent. You could create a third column, hidden usingcolumns.visible
that contains the users. Depending on the format of this field you could use something like this example to show the names in a SearchPane:https://datatables.net/extensions/searchpanes/examples/advanced/renderSearchArrays.html
As long as the data you want to search is part of the parent row data you can setup a way to use SearchPanes to search for it. The data needs to be in a column but can be hidden.
Kevin
That example is a perfect example of the 1 to many data structure I have. Thank you. This is a .net project. In sql I can create a view and use 'stuff' to return a comma separated list, but I like the nested json that your example uses. Is it possible to create json like that in .net?
I'm guessing this is done through the controller using an MJoin??? If so, I have another question posted trying to figure out how to go that route as I am not clear on how to use MJoin correctly.
ok. I figured out the syntax for the controllers and models. It works perfectly. Thank you: