/*========================================================================================= File Name: data-list-view.js Description: List View ---------------------------------------------------------------------------------------- Item Name: Vuesax HTML Admin Template Version: 1.1 Author: PIXINVENT Author URL: http://www.themeforest.net/user/pixinvent ==========================================================================================*/ $(document).ready(function () { "use strict"; // init list view datatable var dataListView = $('.data-list-view').DataTable({ responsive: false, columnDefs: [{ orderable: true, targets: 0, checkboxes: { selectRow: true }, }], "dom": '<"top"<"actions action-btns"B><"action-filters"lf>><"clear">rt<"bottom"<"actions">p>', "oLanguage": { "sLengthMenu": "_MENU_", "sSearch": "" }, "aLengthMenu": [[4, 10, 15, 20], [4, 10, 15, 20]], select: { selector: 'td:first-child', style: 'multi' }, order: [[1, 'asc']], bInfo: false, "pageLength": 4, buttons: [ { text: " Add New", action: function () { $(this).removeClass("btn-secondary") $(".add-new-data").addClass("show") $(".overlay-bg").addClass("show") $("#data-name, #data-price").val(""); $("#data-category, #data-status").prop('selectedIndex', 0); }, className: "btn-outline-primary", } ], initComplete: function (settings, json) { $(".dt-buttons .btn").removeClass("btn-secondary"); }, }); // init thumb view datatable var dataThumbView = $(".data-thumb-view").DataTable({ responsive: false, columnDefs: [{ orderable: true, targets: 0, checkboxes: { selectRow: true }, }], "dom": '<"top"<"actions action-btns"B><"action-filters"lf>><"clear">rt<"bottom"<"actions">p>', "oLanguage": { "sLengthMenu": "_MENU_", "sSearch": "" }, "aLengthMenu": [[4, 10, 15, 20], [4, 10, 15, 20]], select: { selector: 'td:first-child', style: 'multi' }, order: [[1, 'asc']], bInfo: false, "pageLength": 4, buttons: [ { text: " Add New", action: function () { $(this).removeClass("btn-secondary"); $(".add-new-data").addClass("show"); $(".overlay-bg").addClass("show"); }, className: "btn-outline-primary", } ], initComplete: function (settings, json) { $(".dt-buttons .btn").removeClass("btn-secondary"); }, }) // To append actions dropdown before add new button var actionDropdown = $(".actions-dropodown") actionDropdown.insertBefore($(".top .actions .dt-buttons")) // to check and uncheck checkboxes on click of