I cannot seem to get my jQuery Mobile styles to apply to my dynamically filled select. I have tried adding themes, adding the styles manually, refreshing, $('.ui-page-active').trigger('create');
etc. with no luck. The select:
<select id="CandidatesListBox" data-placeholder="true" onchange="myMethod()" style="width: 100%" aria-haspopup="true" class="candidatesList" data-theme="c" ></select>
To fill it:
var geocodeOption = document.createElement('option');
//fill option
if (_isMobile) {
$('#' + geocodesList.id).append(geocodeOption);
$('select#CandidatesListBox').selectmenu();
$('select#CandidatesListBox').selectmenu('refresh', true);
}
The select dropdown itself has the correct styles, but nothing else does. If I add
geocodeOption.className = geocodeOption.className + ' ui-btn';
the select just looks like a select and a button, and again the options contain no styling.
I also tried to read the jQuery forms link 1 and link 2 with no luck. I am using jQuery Mobile 1.4.2.