Selectpicker / DataTables incompatibility
Selectpicker / DataTables incompatibility
Is there a solution to the incompatibility between the Selectpicker plugin and DataTables? If I have a select that uses the bootstrap selectpicker plugin, it works when the page loads. But any (serverSide) callback causes the selectpicker plugin to not work. I can add $(".selectpicker").selectpicker(); to the end of the "column" script that creates that particular column, but it only works in some situations. If I use the search bar, when the table refreshes, it reverts to a normal drop down.
Answers
Since server-side processing will create new rows on each draw, and the select picker is only initialising what it can find on the document (or more specifically what you select with the jQuery select), you need to run that initialisation in the
drawCallback
option.Allan