function buscarBan(b, a){
  const parametros = new FormData();
  parametros.append("txtNom", document.formBancos.txtNom.value);

  $.ajax({
    data:  parametros,
    url:   "busBancos/data.php",
    type:  "post",
    contentType: false,
    processData: false,
    beforeSend: function () {
      alLoad("Consultando...")
    },
    success: function (jsonPhp) {
      const jsonJS = JSON.parse(jsonPhp);

      tblClear("tblBan");
      jsonJS.bancos.forEach(function(i){
        addRowBan(i.ban_num, i.ban_nom);
      });

      $("#tblBan tbody tr").dblclick(function() {
        selecBan(a, $(this));
      });

      $("#tblBan tbody #btnSelecBan").click(function() {
        selecBan(a, $(this).parents("tr"));
      });

      alClose();
    }
  });
}

function addRowBan(cod, nom) {
  const markup =  "<tr>"
                    +"<td>"+cod+"</td>"
                    +"<td>"+nom+"</td>"
                    +"<td><button class='btn btn-sm btn-warning badge' id='btnSelecBan'>"+textBtnSelec+"</button></td>"
                  +"</tr>";
  $("#tblBan tbody").append(markup);
}

function selecBan(a, tr) {
  if (inputNumb == "numNumb") {
    document.thisform.numNumb.value = tr.find("td:eq(0)").text();
    $("form[name='thisform'] #numNumb").trigger("change");
  } else {
    $("#"+inputNumb).val(tr.find("td:eq(0)").text());
    $("#"+inputNumb+"Nom").val(tr.find("td:eq(1)").text());
  }

  $("#pills-"+a+"-tab").click();
  $('html, body').animate( { scrollTop : 0 }, 500 );
  tblClear("tblBan");
}