Search behaving differently than expected with column with both multiple value and null/empty value

Search behaving differently than expected with column with both multiple value and null/empty value

MattBorenMattBoren Posts: 1Questions: 1Answers: 0

Hello-

Firstly, a great product datatables.net is! Tons of features and functionality, and great encapsulation/abstraction such that presenting data with datatables.net can be done in minutes!

I have a question about some behavior in Search that seems inconsistent: search works great with single value columns and/or multi-value columns, but there is a particular use case in which search gives fewer results than expected. When a column has cells with multiple values (say, from an array of values in a JSON data source) and a cell with no value (as in null in the JSON data source), the search results do not search beyond the first "element" in a multi-value cell for any row.

Clarification: by a "multiple value" cell, I am talking about a cell that is, of course, a single string, but that is a string that holds the concatenated values from a JSON array value ("joined" by commas).

The test cases:
1. http://live.datatables.net/durodeji/2/edit Working as expected case: example with rows with single or multiple valued cells in "SupportedOS" column, and searching for a string that is a "second" item in one of the row's SupportedOS string returns two rows (all rows with a cell with the string "2016" in them) -- one row has only the single value, and the other row has "2016" in part of one if it's "multi" values, represented in its comma-joined string
2. http://live.datatables.net/pebofada/1/edit Exhibits unexpected behavior case: cloned from test case number 1 above, but the "SupportedOS" value is changed to null for the "App9" row (a row that is not related to the search for the string "2016"); using the Search box and searching for "2016" returns only one row -- the "App0" row that only a single-valued SupportedOS cell value. The "TestApp10" row that has a comma-joined string of the multiple values (one of which includes the "2016" string in it) is not returned in the search results

The expected behavior would be that a cell having a null value would not change the search results for any other rows. That is, searching for "2016" in these two test cases would return the same two rows (two rows that have the search string in them, and that are not different between the two data sets).

Has anyone else seen this behavior? If so, were you able to rectify the situation?

Thanks,

Matt

This discussion has been closed.