refactor datatables

This commit is contained in:
bobbyvish
2024-03-26 13:22:29 +05:30
parent 64c172ab59
commit 2a4f507a6f
22 changed files with 1191 additions and 391 deletions

View File

@@ -43,13 +43,13 @@
<tr role="row">
<th class="checkbox-column sorting_asc text-center" tabindex="0"
aria-controls="style-3" aria-sort="ascending"
style="width: 50.2656px;">#</th>
style="width: 50.2656px;">Record Id</th>
<th class="sorting text-center" tabindex="1" aria-controls="style-3"
colspan="1"
style="width: 44.2344px;">Email Address</th>
<th class="sorting text-center" tabindex="2" aria-controls="style-3"
colspan="1"
style="width: 44.2344px;">Subject</th>
style="width: 44.2344px;">Reaction</th>
<th class="sorting text-center" tabindex="3" aria-controls="style-3"
colspan="1"
style="width: 44.2344px;">Message</th>
@@ -161,8 +161,8 @@ function initializeDataTable(tableName, mainUrl) {
debug: true,
columnDefs: [
{
"targets": [3],
"render": function (data, type, row) {
targets: [3],
render: function (data, type, row) {
// Adjust the length of text you want to show before truncating
var maxLength = 40;
// Truncate the text if it exceeds the maxLength
@@ -172,10 +172,10 @@ function initializeDataTable(tableName, mainUrl) {
}
},
{
targets: [1, 2, 3],
targets: [0, 1, 2, 3],
searchable: true,
orderable: true
}
},
],
dom: "<'dt--top-section'<'row'<'col-12 col-sm-6 d-flex justify-content-sm-start justify-content-center'l><'col-12 col-sm-6 d-flex justify-content-sm-end justify-content-center mt-sm-0 mt-3'Bf>>>" +
"<'table-responsive'tr>" +