I have around 25 dropdowns and don't want to load all those dropdown unless the user clicks on them. I want to load the drodown only when the user actually clicks on the dropdown as each dropdown is tied to API call.
What I have a has a bug and the dropdown only get populated after second click, not the first click. The variables have data, but UI doesn't reflect that.
Does anyone has any thoughts? Here is what it looks like:
tr.find("select").click(function () {
if ($(this).children().length <= 1) { // checking no of options; first one is default
var fieldName = $(this).attr('id');
var selectValues = scope.getFilterData({ fieldName: fieldName }); // get formatted option values
$(this).append(getSelectOptions(selectValues));
} }
});