Feeding the search filter input simultaneously to PHP

Feeding the search filter input simultaneously to PHP

mk0mk0 Posts: 10Questions: 2Answers: 0

Are there any code examples for how to achieve the case where when the user is making an input to the search box filter, that same input is being passed to php? For example if I want to do some data processing server-side with python (e.g. run a deep learning model) and show the result in the same view but outside the table. The initial state would show those values for the whole dataset, and once the user filters, it would show those values for the filtered down dataset. What would be the best way to achieve this?

Answers

  • kthorngrenkthorngren Posts: 21,299Questions: 26Answers: 4,945

    This example will show you how to capture the global search filter.
    http://live.datatables.net/jorexujo/3/edit

    Within that function you would send an ajax call to your Python server with the server string. It will fire for each keystroke.

    Kevin

  • mk0mk0 Posts: 10Questions: 2Answers: 0

    That's amazing! Thank you very much. This gave some hints to the average thread, I will update there. But this works perfectly, I plug it in to a plain vanilla datatables example, and I can see the inputs in console :) Really very much thank you! :)

This discussion has been closed.