0

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

Gary
  • 3
  • 3
  • take a look [here](https://stackoverflow.com/questions/448981/which-characters-are-valid-in-css-class-names-selectors) you can change id selector with `yqBdItemList_0_price` – Y.C. May 21 '22 at 11:38

0 Answers0