Skip to content Skip to sidebar Skip to footer

Dropdown Selection Using Server Side Datatable | Php, Sql Server

I have a problem when selecting the dropdown in server-side data table. This is based on this example: https://datatables.net/examples/api/multi_filter_select.html. I have this gui

Solution 1:

Example you are referring to has static data and does filter in UI itself.

But in your case you are using server side processing which means sorting logic should be handle by the server side code.

initComplete method consider data returned by the API and fills the combobox, which is what it need to do.

To make it work as per your requirement

  1. Don't use server side processing and load all data at once as given in example

  2. If you need to use Server side processing

    You might need to customize initComplete function to call another API which returns all unique columns data and loads it.

    Note: Also you might need to write logic for "when you select a value from combobox"

    I am sure Datatable will add selected combo value as parameter to API and based on that you need to process data in backend and return appropriate response.

Post a Comment for "Dropdown Selection Using Server Side Datatable | Php, Sql Server"