Custom filtering - pass filter value to user's callback

Custom filtering - pass filter value to user's callback

tmrczktmrczk Posts: 1Questions: 1Answers: 0

Hi all,

I'm trying to create custom data search method that is similar to this:

https://datatables.net/examples/plug-ins/range_filtering.html

In my case, there's only one text search input.

I'm surprised that my search method does not receive the search context. Is that done on purpose?

There's this line:

https://github.com/DataTables/DataTables/blob/master/media/js/jquery.dataTables.js#L4297

  1. Why doesn't it pass oInput further on?
  2. What's the recommended method of figuring out search context in search callback?

Thanks!

Answers

  • allanallan Posts: 63,464Questions: 1Answers: 10,466 Site admin

    Hi,

    I'm not entirely sure what you mean by "context" here I'm afraid. Do you mean the input element's context? Or just the oInput object?

    That isn't passed on to the search plug-ins as I wasn't expecting it to be useful there. The built in search input uses its own built in filtering methods. For plug-ins, they shouldn't really care about that the built in search is since they are an addition to it. If they need an input element, they should define their own.

    Allan

This discussion has been closed.