ColumnControl: SearchList does not appropriately parse characters

ColumnControl: SearchList does not appropriately parse characters

KuronumaKuronuma Posts: 14Questions: 5Answers: 0

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:

  1. 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.
  2. 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 &lt;)
    • greater than (> or &gt;)

Answers

  • allanallan Posts: 64,631Questions: 1Answers: 10,686 Site admin

    1) they are being treated as separate values.

    That's because they are :). You could use a custom rendering function that checks for the filter type data request, and when spotted trim() the data. I think it would be easier if you were to simply trim the data before loading it into the DataTable though.

    2)

    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

  • KuronumaKuronuma Posts: 14Questions: 5Answers: 0
    edited June 16

    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:

    Path Permission Name Permission Description
    Module > Sub-Module > Page Permission 1 Description for permission 1
    Module > Sub-Module > Page Permission 2 Description for permission 2
    Module > Sub-Module > Page Permission 3 Description for permission 3

    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, the filter 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.

  • KuronumaKuronuma Posts: 14Questions: 5Answers: 0

    @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.

Sign In or Register to comment.