![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/clinic.corals.io/resources/assets/js/fronts/faqs/ |
'use strict'; let tableName = '#faqsTable'; let tbl = $(tableName).DataTable({ processing: true, serverSide: true, searchDelay: 500, 'language': { 'lengthMenu': 'Show _MENU_', }, 'order': [[1, 'asc']], ajax: { url: route('faqs.index'), }, columnDefs: [ { 'targets': [2], 'orderable': false, 'className': 'text-center', 'width': '8%', }, ], columns: [ { data: 'question', name: 'question', }, { data: 'answer', name: 'answer', }, { data: function (row) { let data = [ { 'id': row.id, 'editUrl': route('faqs.edit', row.id), }, ]; return prepareTemplateRender('#actionsTemplates', data); }, name: 'id', }, ], }); handleSearchDatatable(tbl); $(document).on('click', '.delete-btn', function (event) { let recordId = $(event.currentTarget).data('id'); deleteItem(route('faqs.destroy', recordId), tableName, 'FAQ'); });