I have an get request which fetches a bunch of category information to populate a <select>. I'm using jQuery UI Selectmenu to style my select.
So my jQuery looks a little like this:
//Initalise the selectmenu
$("select").selectmenu({ style: 'dropdown' });
$.get("http://localhost/somedata?cat=2", function (data) {
$.each(data, function (index, itemData) {
$("<option value='" + itemData.Id + "'>" + itemData.Name + "</option>").appendTo("#selectList");
});
});
However this populates the <select> but does not update the jQuery UI selectmenu. Any ideas what I need to do to get the selectmenu to be 're-drawn' so the new values appear in the selectmenu?