Filtering 3 rows via dropdown

Filtering 3 rows via dropdown

Unleashed2kUnleashed2k Posts: 4Questions: 1Answers: 0

Hello,

I'm working on a new song serverside datatable that reads from mysql
I have about 8+ columns but we have 3 columns (Lead, Rhythm, Bass) that we want to filter via a dropdown.

The filter dropdown would contain the following:
Lead
Rhythm
Lead or Rhythm
Bass

My setup is currently using serverside processing so I'm not sure how to do this properly. Any help would be amazing.

Here's a demo: http://live.datatables.net/gogedeco/1/

Answers

  • Unleashed2kUnleashed2k Posts: 4Questions: 1Answers: 0

    What's the best way to handle the "OR" part of this at least?

  • kthorngrenkthorngren Posts: 21,160Questions: 26Answers: 4,921

    With server side processing the search is performed by your server script. Are you using one of the server side examples provided by Datatables or is it your own script?

    Kevin

  • Unleashed2kUnleashed2k Posts: 4Questions: 1Answers: 0

    We are using Laravel Datatables - https://yajrabox.com/docs/laravel-datatables/master but still writing everything using datatable's JS

  • kthorngrenkthorngren Posts: 21,160Questions: 26Answers: 4,921

    It looks like the Laravel Datatables search documentation is here:
    https://yajrabox.com/docs/laravel-datatables/master/filter-column

    I suggest that if you have questions about how to perform searches with their library you ask on their support forums. With server side processing enabled the searching will process will be the Laravle Datatables library not Datatables itself.

    Kevin

  • Unleashed2kUnleashed2k Posts: 4Questions: 1Answers: 0

    You can see some of our normal datatables code here:
    https://ignition4development.customsforge.com/js/homeModule.js
    We couldn't get $.fn.dataTable.ext.search.push( to work obviously because of server side but our other functions are working okay. Our other methods are working fine so not sure why we couldn't do something with regex to get a solution.

  • kthorngrenkthorngren Posts: 21,160Questions: 26Answers: 4,921

    Like I said with server side processing enabled all the search functions are the responsibility of the server script. In your case it is the Laravel Datatables framework you are using. You will need to contact the developers of this framework for detailed help with their framework. Looks like their support area is here:
    https://github.com/yajra/laravel-datatables/issues

    Kevin

  • kthorngrenkthorngren Posts: 21,160Questions: 26Answers: 4,921

    For more information you can read the server side processing doc:
    https://datatables.net/manual/server-side

    You will see in the doc that the search information for global and the columns is sent to the server. It will also send whether the search is a regex or not. The server script is responsible for understanding these parameters and responding with the correct data.

    Kevin

This discussion has been closed.