Estoy usando una tabla de arranque para mostrar mis datos. Usé un formateador de datos en una columna como:
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; }luego usa jquery para establecer el valor, pero no funciona:
$('#yqBdItemList[0].price').val('1111') si uso updateCell o updateRow , la columna select2 no será válida y no funcionará
función bootstrap-table onLoadSuccess:
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' }) }) } onLoadSuccess no será válido después updateCell o updateRow