Select/Option is losing its class when navigating back
Select/Option is losing its class when navigating back
I have a DataTable that uses serverSide processing. One of the columns is defined like this:
"data": function (row, type, val, meta) {
return "<select class='selectpicker'>" +
"<option value='1'>Test Value</option>" +
"</select>";
}
Works great. But, when I click on a link on this page, then navigate back, the dropdown loses the "selectpicker" class. Why? I need the dropdown to retain that class because I have events that depend on it being present.
Answers
It seems to be completely random. When it's the only column being returned in the grid, it seems to work most of the time, but usually it's totally broken.
This doesn't even work.
$('select').addClass("selectpicker");
It'll apply the style to the "show __ entries" dropdown, but not the one in the grid: