$(() => {
    // DATATABLE
    if (jQuery().DataTable) {
        let dataUser = $("#ArtikelTable");
        const url = dataUser.attr("data-url");

        let dTable = dataUser.DataTable({
            order: [[1, "asc"]],
            processing: true,
            ordering: false,
            serverSide: true,
            ajax: {
                url: url,
                type: "POST",
            },
            columns: [
                {
                    data: "DT_RowIndex",
                    orderable: false,
                    searchable: false,
                    width: "25px",
                    className: "align-center",
                },
                { data: "tittle", className: "align-middle" },
                { data: "status", className: "align-center" },
                { data: "publish_date", className: "align-center" },
                { data: "date_perubahan", className: "align-center" },
                {
                    data: "action",
                    orderable: false,
                    searchable: false,
                    width: "50px",
                    className: "align-center",
                },
            ],
        });
    }
});

