selectpicker not refreshing after form submit
I have a selectpicker in a dynamic table inside of a form (can add rows, delete rows).
My form submits correctly with all data. I am passing the index of the row where the selectpicker is located back to the success function in ajax. I need the selecpicker to refresh to pick-up the new product that was just inserted into the database. I know the index of the row that was clicked, just can't figure out how to refresh the selectpicker. Any help would be greatly appreciated.
$("#frmAddProduct").on('submit', function(e){ e.preventDefault();
var form_data = new FormData(this);
var post_url = $(this).attr("action");
$.ajax({
url: post_url,
type: 'POST',
data: form_data,
contentType: false,
cache: false,
processData: false,
mimeType:'multipart/form-data',
success: function(data){
var rowIdx = data;
//console.log(rowIdx);
$('.selectpicker').selectpicker('refresh');
}
});
});`
same issue am facing any solution??
-
Provide environment details. Provide your operating system, browser(s), jQuery version, Bootstrap version, and bootstrap-select version.
-
Create an isolated and reproducible test case. Create a reduced test case.
-
Include a live example. Use this Plunker debugging template to share your isolated test cases. You can also make use of jsFiddle or jsBin.
ninguna solucion que soporte