(function ($) {
    "use strict";
    var knowledgeAdminTableSerch
    $(document).on('input', '#knowledgeAdminSearch', function () {
        knowledgeAdminTableSerch.search($(this).val()).draw();
    });
    knowledgeAdminTableSerch =  $('#knowledgeDataTable').DataTable({
        pageLength: 25,
        ordering: false,
        serverSide: true,
        processing: true,
        responsive: true,
        searing: false,
        ajax: $('#news-list-route').val(),
        language: {
            paginate: {
                previous: "<span class='iconify' data-icon='material-symbols:chevron-left-rounded'></span>",
                next: "<span class='iconify' data-icon='material-symbols:chevron-right-rounded'></span>",
            },
            searchPlaceholder: "Search",
            search: ""
        },
        dom: '<>tr<"tableBottom"<"row"<"col-sm-6"i><"col-sm-6"p>>><"clear">',
        columns: [
            {"data": "category_name", "name": "category_name"},
            {"data": "title", "name": "title"},
            {"data": "status", "name": "status"},
            {"data": "action", searchable: false, responsivePriority:2},
        ]
    });

    $(".add-knowledge-modal").on("click", function () {
        $("#knowledgeAddForm").trigger("reset");
        $('.summernote').summernote('reset');
    });

})(jQuery)
