search / filter in array source

search / filter in array source

ansarigmbhansarigmbh Posts: 24Questions: 7Answers: 0
edited February 2015 in Feature requests

Hi

If we have an array as a source data for a column and it is going to be filtered in DataTables v1.10.3, passing a part of the string to search function, DataTables will filter it.

But in v1.10.4 It doesn't work. I have debugged it and understood that is due to a render function I used which returns raw data(array) when the filter type is used and DataTables can not convert it to string in its search function. Therefore in my render function I have to convert the array to string by toString()(in v1.10.3 it wasn't necessary).

I was wondering why we can not filter by both array and string?

Replies

  • allanallan Posts: 61,972Questions: 1Answers: 10,160 Site admin

    Can you link me to a test page showing the problem so I can take a look to see what is going on?

    Thanks,
    Allan

  • ansarigmbhansarigmbh Posts: 24Questions: 7Answers: 0

    Hi

    Thanks for reply :-)

    Here ( http://live.datatables.net/rujicuti/1/ ) is a test page but I do not understand! I can not see my App's bug. I'm sure that there is a deference between version 1.10.3 and 1.10.4 in my App. Please see my comments in JS codes.

    I changed my DataTables JS links to your online links and my problem didn't solve.

    And finally I read render documentation more carefully anther time and understood why I have this problem!

    In my render function first I check filter type and then it returns display render for other types. I reversed it and everything work well.

    But I am still insist on my suggestion.

    Thanks :-)

  • allanallan Posts: 61,972Questions: 1Answers: 10,160 Site admin

    Thanks for the test case!

    DataTables will convert non-string data to strings automatically for searching in 1.10.4. Indeed, your arrays are used as 1,3 (for example) as strings in your example which is using 1.10.4. I don't quite understand what part isn't working for you there.

    Allan

  • ansarigmbhansarigmbh Posts: 24Questions: 7Answers: 0

    Yes. I know that arrays are used as strings and make a regular expression search based on.

    Thanks

This discussion has been closed.