I have a SPA that I am working with that collects some data on the main page. I send the data to the controller, call a service and return a dataset to load into a partial view. The html select control is not getting styled using the jquery selectric elements that I would expect. I placed a select on the main page and it does style properly. I understand why it does not but is there a way to refresh the select control to get styled after the partial view loads
Main Form
Partial View
I added jquery Code to load the options on the select after the partial view renders and that works properly. I did that thinking that I could redraw the elements getting the selectric to apply but it didn't work. I even added a line to reinitialize selectric and that didn't change anything. Any thoughts?
<script type="text/javascript">
$(function() {
var text = ['--None--', 'Own', 'Rent'];
var value = ['', 'Own', 'Rent'];
var $select = $('#00N4100000e8OsC');
for (var i = 0; i < text.length; i++) {
var o = $('<option/>', { value: value[i] })
.text(text[i])
.prop('selected', i == 0);
o.appendTo($select);
}
$('select').selectric('init');
});
</script>