ColumnControl: SearchList does not appropriately parse characters
ColumnControl: SearchList does not appropriately parse characters

Hello!
I recently installed the latest update to DataTables and I have enabled the new Column Control extension. There are two issues I am running into:
- With the SearchList content type enabled for a column, if I have two values in a column that are the same except one value has a space character (at the beginning, end, or somewhere in between) and the other doesn't, they are being treated as separate values.
- With the SearchList content type enabled for a column, if a value in a column has one of these special characters, it will not be returned when the column is filtered by that value:
- non-breaking space (
 
) - less than (
<
or<
) - greater than (
>
or>
)
- non-breaking space (
Answers
That's because they are
. You could use a custom rendering function that checks for the
filter
type data request, and when spottedtrim()
the data. I think it would be easier if you were to simply trim the data before loading it into the DataTable though.Can you give me a link to the page showing the issue? I'd like to see how the data is being loaded (i.e. HTML with entities, or from JSON, etc)?
Thanks,
Allan
I see what you are saying - for context, we use DataTables to display long tables in our product documentation. So while it makes sense to treat each value as unique in most cases, in our case, we would treat those values as the same. I'll look into the custom renderer, thank you!
Unfortunately, our company privacy policies don't allow me to share a link, but I can provide you with a generic example. We have our user permissions documented in a datatable that roughly follows this format:
If I have the
SearchList
content type set for column 1 (Path) and I attempt to filter that column by a value that contains a>
character, thefilter
event executes but the DataTable says "No matching records found." It would be ideal to be able to filter the column by a specific path in the permissions tree.As I type this out, it occurs to me that I could most likely use a custom renderer to solve this problem as well, but I am not sure how I would handle this specific scenario. Do you have any thoughts?
We use JQuery to apply DataTables to tables with a specific style class.
@allan Something I realized yesterday in relation to issue #2 - when I use the main search field (to search the entire table), the filtering works as expected. So I think there is definitely something happening with how those special characters are parsed.