jquery-flexselect icon indicating copy to clipboard operation
jquery-flexselect copied to clipboard

When initialising on dynamic selects it does not populate

Open GlynnPowell opened this issue 2 years ago • 0 comments

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();
    }
});

}

GlynnPowell avatar May 20 '22 12:05 GlynnPowell