Parsing and searching Nested Tables

Parsing and searching Nested Tables

BaedianBaedian Posts: 1Questions: 1Answers: 0

I am currently using this plugin as tool to search a pool of data from an SQL server without the need to re-query the database. What I am trying to do I can easily do in SQL queries but that is not an option due to some project limitations. I am trying to provide a way of searching parent Items and narrow down the list based on information within a set of child tables.

Table Parent Contains: Start Date, End Date, Title, Times (Nested Table)
The nested child table contains: Date, Start Time, End Time

What I am trying to do is search for events a narrow down a subset within both a date range, and time range.
Currently I have written out the data as a Nested Table, when initiated the column containing the Child Table is hidden, it also is never going to be displayed, at least not in the context of DataTables plugin.

Example:

<table>
<thead><tr><th>Title</th><th>Date, Start</th><th>Date, End</th><th>Times</th></tr></thead>
<tbody><tr><td>Irvine Event Title</td><td>12/05/2001</td><td>12/06/2001</td><td><table>....</table></td></tr></tbody>
</table>

For doing the search I found this: https://datatables.net/examples/plug-ins/range_filtering.html which ill be applying to the start and end date for date range searches, the start and end date are part of the parent table and the children will always be between those dates (inclusive).

When extending the search I found data does not contain an array of data, instead the contents are converted to STRING.
I could parse the string to an array using the jquery plugin tableToJSON but id have to do this per search. I'd rather do this one time, when the data is being read in and ideally put in in the data object that is used during search. I cannot find a place to hook in an do insert the data as an object or array of objects. Alternatively I could store this data externally, using a key from the parent, but again I can't find a place to hook in to parse the data per row one time. Any suggestions, or alternatives?

USE CASE:
Search (Text Inputs):
Date: 12/05/2001 to 12/06/2001
Time: 10:00 AM to 2:00 PM

Result: Only the "Irvine Event Title" dataset is displayed.

Sample Data
Parent: [ Title, Start Date, End Date, times],
Child (times column) : [ Date, Start Time, End Time]
{
["Los Angeles Event Title", "12/05/2001", "12/06/2001", [ ['12/05/2001','3:00 PM, '5:00 PM'],['12/06/2001','3:00 PM', '5:00PM'],['12/06/2001','6:00 PM', '7:00PM'], ['12/06/2001','7:00 AM', '9:00 AM'] ] ],
["San Diego Event Title", "12/07/2001", "12/08/2001", [ ['12/07/2001','11:00 AM', '12:05PM'],['12/08/2001','11:00 AM', '12:00PM'] ] ],
["Irvine Event Title", "12/06/2001", "12/07/2001", [ ['12/06/2001','11:00 AM', '12:05PM'],['12/07/2001','11:00 AM', '12:00PM'] ] ]
}

This discussion has been closed.