SHARE
TWEET

consultation js

a guest Sep 22nd, 2019 85 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function addSelectedFIPTJ() {
  2.     var regpk = $('#regpk').val();
  3.     var link = $('#consultationModel_LINK').val();
  4.  
  5.     if ($('input[name="source_no_utmfin"]').is(":checked")) {
  6.         $("#cekUTMFINPart").val("Yes");
  7.     }
  8.     else {
  9.         $("#cekUTMFINPart").val("No");
  10.     }
  11.     $("#regpk2").val(regpk);
  12.     var myformdata = $("#modalutmfin").serialize();
  13.     $.ajax({
  14.         type: "POST",
  15.         url: "/Consultation/SaveFinanceInfoPTJ",
  16.         data: myformdata,
  17.         success: function (data) {
  18.  
  19.             if (link === "NEW") {
  20.                 var tablenew = $("#listViewTableUTMFINnew").DataTable();
  21.                 tablenew.ajax.reload(); //reload datatable
  22.  
  23.                 var table1new = $("#listFinancialTransactionPTJnew").DataTable();
  24.                 table1new.ajax.reload(); //reload datatable
  25.  
  26.                 var table2new = $("#listFinancialTransactionSUBnew").DataTable();
  27.                 table2new.ajax.reload(); //reload datatable
  28.  
  29.             } else if (link === "LIST") {
  30.                 var table = $("#listViewTableUTMFIN").DataTable();
  31.                 table.ajax.reload(); //reload datatable
  32.  
  33.                 var table1 = $("#listFinancialTransactionPTJ").DataTable();
  34.                 table1.ajax.reload(); //reload datatable
  35.  
  36.                 var table2 = $("#listFinancialTransactionSUB").DataTable();
  37.                 table2.ajax.reload(); //reload datatable
  38.  
  39.             } else { }
  40.  
  41.             return swal({
  42.                 title: "",
  43.                 text: "Data has been successfully added!",
  44.                 type: "success",
  45.                 confirmButtonClass: "OK"
  46.             }), !1
  47.         },
  48.         error: function (data) {
  49.             console.log('An error occurred.');
  50.             console.log(data);
  51.         },
  52.     });
  53. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top