"use strict";var KTDefaultDatatableDemo=function(){var t=function(t){var a=$("#kt_datatable_console").append(t+"\t\n");$(a).scrollTop(a[0].scrollHeight-$(a).height())};return{init:function(){var a;a=$("#kt_datatable").KTDatatable({data:{type:"remote",source:{read:{url:HOST_URL+"/api/datatables/demos/default.php"}},pageSize:5,serverPaging:!0,serverFiltering:!0,serverSorting:!0},layout:{scroll:!0,minHeight:null,footer:!1},sortable:!0,toolbar:{placement:["bottom"],items:{pagination:{pageSizeSelect:[5,10,20,30,50]}}},search:{input:$("#kt_datatable_search_query"),key:"generalSearch"},columns:[{field:"RecordID",title:"#",sortable:!1,width:30,type:"number",selector:{class:"checkbox"},textAlign:"center"},{field:"OrderID",title:"Order ID"},{field:"Country",title:"Country",template:function(t){return t.Country+" "+t.ShipCountry}},{field:"ShipDate",title:"Ship Date",type:"date",format:"MM/DD/YYYY"},{field:"CompanyName",title:"Company Name"},{field:"Status",title:"Status",template:function(t){var a={1:{title:"Pending",class:"label-light-primary"},2:{title:"Delivered",class:" label-light-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''+a[t.Status].title+""}},{field:"Type",title:"Type",autoHide:!1,template:function(t){var a={1:{title:"Online",state:"danger"},2:{title:"Retail",state:"primary"},3:{title:"Direct",state:"success"}};return''+a[t.Type].title+""}},{field:"Actions",title:"Actions",sortable:!1,width:125,overflow:"visible",autoHide:!1,template:function(){return'\t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t '}}]}),$("#kt_datatable_search_status").on("change",function(){a.search($(this).val().toLowerCase(),"Status")}),$("#kt_datatable_search_type").on("change",function(){a.search($(this).val().toLowerCase(),"Type")}),$("#kt_datatable_search_status, #kt_datatable_search_type").selectpicker(),$("#kt_datatable").on("datatable-on-init",function(){t("Datatable init")}).on("datatable-on-layout-updated",function(){t("Layout render updated")}).on("datatable-on-ajax-done",function(){t("Ajax data successfully updated")}).on("datatable-on-ajax-fail",function(a,e){t("Ajax error")}).on("datatable-on-goto-page",function(a,e){t("Goto to pagination: "+e.page)}).on("datatable-on-update-perpage",function(a,e){t("Update page size: "+e.perpage)}).on("datatable-on-reloaded",function(a){t("Datatable reloaded")}).on("datatable-on-check",function(a,e){t("Checkbox active: "+e.toString())}).on("datatable-on-uncheck",function(a,e){t("Checkbox inactive: "+e.toString())}).on("datatable-on-sort",function(a,e){t("Datatable sorted by "+e.field+" "+e.sort)})}}}();jQuery(document).ready(function(){KTDefaultDatatableDemo.init()});