pos-gis/public/assets/js/pages/crud/ktdatatable/child/data-ajax.min.js

1 line
9.9 KiB
JavaScript
Raw Permalink Normal View History

2024-10-07 06:13:42 +00:00
"use strict";var KTDatatableChildRemoteDataDemo={init:function(){var t;t=$("#kt_datatable").KTDatatable({data:{type:"remote",source:{read:{url:HOST_URL+"/api/datatables/demos/customers.php"}},pageSize:10,serverPaging:!0,serverFiltering:!1,serverSorting:!0},layout:{scroll:!1,footer:!1},sortable:!0,pagination:!0,detail:{title:"Load sub table",content:function(t){$("<div/>").attr("id","child_data_ajax_"+t.data.RecordID).appendTo(t.detailCell).KTDatatable({data:{type:"remote",source:{read:{url:HOST_URL+"/api/datatables/demos/orders.php",params:{query:{generalSearch:"",CustomerID:t.data.RecordID}}}},pageSize:5,serverPaging:!0,serverFiltering:!1,serverSorting:!0},layout:{scroll:!1,footer:!1,spinner:{type:1,theme:"default"}},sortable:!0,columns:[{field:"RecordID",title:"#",sortable:!1,width:30},{field:"OrderID",title:"Order ID",template:function(t){return"<span>"+t.OrderID+" - "+t.ShipCountry+"</span>"}},{field:"ShipCountry",title:"Country",width:100},{field:"ShipAddress",title:"Ship Address"},{field:"ShipName",title:"Ship Name"},{field:"TotalPayment",title:"Payment",type:"number"},{field:"Status",title:"Status",template:function(t){var e={1:{title:"Pending",class:"label-light-primary"},2:{title:"Delivered",class:" label-light-danger"},3:{title:"Canceled",class:" label-light-primary"},4:{title:"Success",class:" label-light-success"},5:{title:"Info",class:" label-light-info"},6:{title:"Danger",class:" label-light-danger"},7:{title:"Warning",class:" label-light-warning"}};return'<span class="label '+e[t.Status].class+' label-inline label-bold">'+e[t.Status].title+"</span>"}},{field:"Type",title:"Type",autoHide:!1,template:function(t){var e={1:{title:"Online",state:"danger"},2:{title:"Retail",state:"primary"},3:{title:"Direct",state:"success"}};return'<span class="label label-'+e[t.Type].state+' label-dot mr-2"></span><span class="font-weight-bold text-'+e[t.Type].state+'">'+e[t.Type].title+"</span>"}}]})}},search:{input:$("#kt_datatable_search_query"),key:"generalSearch"},columns:[{field:"RecordID",title:"",sortable:!1,width:30,textAlign:"center"},{field:"checkbox",title:"",template:"{{RecordID}}",sortable:!1,width:20,textAlign:"center",selector:{class:"kt-checkbox--solid"}},{field:"FirstName",title:"First Name",sortable:"asc"},{field:"LastName",title:"Last Name"},{field:"Company",title:"Company"},{field:"Email",title:"Email"},{field:"Address",title:"Address"},{field:"Status",title:"Status",template:function(t){var e={1:{title:"Pending",class:"label-light-primary"},2:{title:"Delivered",class:" label-light-danger"},3:{title:"Canceled",class:" label-light-primary"},4:{title:"Success",class:" label-light-success"},5:{title:"Info",class:" label-light-info"},6:{title:"Danger",class:" label-light-danger"},7:{title:"Warning",class:" label-light-warning"}};return'<span class="label '+e[t.Status].class+' label-inline font-weight-bold label-lg">'+e[t.Status].title+"</span>"}},{field:"Type",title:"Type",autoHide:!1,template:function(t){var e={1:{title:"Online",state:"danger"},2:{title:"Retail",state:"primary"},3:{title:"Direct",state:"success"}};return'<span class="label label-'+e[t.Type].state+' label-dot mr-2"></span><span class="font-weight-bold text-'+e[t.Type].state+'">'+e[t.Type].title+"</span>"}},{field:"Actions",width:125,title:"Actions",sortable:!1,overflow:"visible",autoHide:!1,template:function(){return'\t <div class="dropdown dropdown-inline">\t <a href="javascript:;" class="btn btn-sm btn-clean btn-icon mr-2" data-toggle="dropdown">\t <span class="svg-icon svg-icon-md">\t <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="24px" height="24px" viewBox="0 0 24 24" version="1.1">\t <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\t <rect x="0" y="0" width="24" height="24"/>\t <path d="M5,8.6862915 L5,5 L8.6862915,5 L11.5857864,2.10050506