jquery-flexselect
jquery-flexselect copied to clipboard
When initialising on dynamic selects it does not populate
I load in my select dynamically like below, and it nearly works except the UL generated by flex select is empty
(Otherwise this awesome, I hate to point this out!! an ideas ?)
- I even added a half-second delay to make sure it had populated first
function loadActivitySelect() {
var $activityContainer = $('#ActivitySelectContainer');
$.ajax({
type: 'GET',
url: '/MyGames?handler=ActivitySelect',
contentType: 'application/json',
dataType: 'html',
success: function (response) {
// Appends a select to this element
$activityContainer.empty();
$activityContainer.append(response);
var $activitySelect = $activityContainer.find('select');
setTimeout(function () {
$activitySelect.flexselect();
}, 500);
},
failure: function (response) {
$activityContainer.empty();
}
});
}