I am using bootstrap table to display my data. I used a data formatter on a column like:
formatter: function (value, row, index) {
var html = $.common.sprintf("<input class='form-control' type='text' id='yqBdItemList[" + index + "].price' name='yqBdItemList[%s].price' value='%s'>", index, value);
return html;
}
then using jquery to set value,but it's not working :
$('#yqBdItemList[0].price').val('1111')
if i use updateCell or updateRow, the select2 column will invalid
good
not woring
bootstrap-table onLoadSuccess function:
function onLoadSuccess(data) {
$.fn.select2.defaults.set("theme", "bootstrap");
$("select.form-control").each(function () {
$(this).select2().on("change", function () {
const data = JSON.parse($(this).select2('val'))
console.log(data)
// $(this).valid();
})
})
$(".check-box").each(function () {
$(this).iCheck({
checkboxClass: 'icheckbox-blue'
})
})
}
the onLoadSuccess will invalid after updateCell or updateRow