Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When initialising on dynamic selects it does not populate #46

Open
GlynnPowell opened this issue May 20, 2022 · 0 comments
Open

When initialising on dynamic selects it does not populate #46

GlynnPowell opened this issue May 20, 2022 · 0 comments

Comments

@GlynnPowell
Copy link

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

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant