text: var table;$((function(){$("#tbl_data").on("click",".btn_hapus",(function(){var id=$(this).attr("data-id"),status;confirm("Yakin ingin menghapus?")&&$.ajax({url:link+"/hapusData",type:"POST",data:{id:id},success:function(response){$("#tbl_data").DataTable().ajax.reload(null,!1)}})})),$("#tbl_data").on("click",".btn_edit",(function(){var id=$(this).attr("data-id");$.ajax({url:link+"/ambilDataById",type:"POST",data:{id:id},dataType:"json",success:function(response){$("#editModal").modal("show");for(var i=0;i<=response.key_count;i++)dummyval=response.key[i],$('input[name="'+response.key[i]+'_edit"]').val(response.data[dummyval]);$("#tbl_data").DataTable().ajax.reload(null,!1)}})})),$("#btn_update_data").on("click",(function(){var id=$('input[name="id_edit"]').val(),name=$('input[name="name_edit"]').val(),b_price=$('input[name="b_price_edit"]').val(),s_price=$('input[name="s_price_edit"]').val();$.ajax({url:link+"/perbaruiData",type:"POST",data:{id:id,name:name,b_price:b_price,s_price:s_price},success:function(response){$('input[name="name_edit"]').val(""),$('input[name="b_price_edit"]').val(""),$('input[name="s_price_edit"]').val(""),$("#editModal").modal("hide"),$("#tbl_data").DataTable().ajax.reload(null,!1)}})}))})),$((function(){$(document).ready((function(){var link=$(location).attr("pathname");table=$("#tbl_data").DataTable({responsive:!0,serverSide:!0,autoWidth:!1,sScrollY:"300",sScrollX:"100%",bSort:!1,iDisplayLength:10,bLengthChange:!1,order:[],ajax:{url:link+"/get_data",type:"POST"},columnDefs:[{targets:[0,3],orderable:!1},{targets:-1,width:"200",orderable:!1}]})}))}));