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

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

      tblClear("tblTipov");
      jsonJS.tipov.forEach(function(i){
        addRowTipov(i.tv_cod, i.tv_nom);
      });

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

      $("#tblTipov tbody #btnSelecTipov").click(function() {
        selectTipov(a, $(this).parents("tr"));
      });

      alClose();
    }
  });
}

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

function selectTipov(a, tr) {
  $("#pills-"+a+"-tab").click();
  /*if (inputProvee == "txtNit") {
    document.thisform.txtNit.value = tr.find("td:eq(0)").text();
    $("form[name='thisform'] #txtNit").trigger("change");
  } else {*/
    $("#"+inputTipov).val(tr.find("td:eq(0)").text());
    $("#"+inputTipov).trigger("change");
  //}

  //$('html, body').animate( { scrollTop : 0 }, 500 );
  tblClear("tblTipov");
}