Add hidden Custom Fields column to export table

This commit is contained in:
JonnyWong16 2020-10-01 21:42:15 -07:00
parent 627129dd95
commit 900b524672
No known key found for this signature in database
GPG key ID: B1F1F9807184697A
3 changed files with 17 additions and 3 deletions

View file

@ -637,6 +637,7 @@ DOCUMENTATION :: END
<th align="left" id="file_format">File Format</th>
<th align="left" id="metadata_level">Metadata Level</th>
<th align="left" id="media_info_level">Media Info Level</th>
<th align="left" id="media_info_level">Custom Fields</th>
<th align="left" id="file_size">File Size</th>
<th align="left" id="complete">Download</th>
<th align="left" id="delete">Delete</th>
@ -978,7 +979,7 @@ DOCUMENTATION :: END
}
};
export_table = $('#export_table-RK-${data["rating_key"]}').DataTable(export_table_options);
export_table.column(2).visible(false);
export_table.columns([2, 7]).visible(false);
var colvis = new $.fn.dataTable.ColVis(export_table, { buttonText: '<i class="fa fa-columns"></i> Select columns', buttonClass: 'btn btn-dark' });
$(colvis.button()).appendTo('#button-bar-export');

View file

@ -118,6 +118,17 @@ export_table_options = {
},
{
"targets": [7],
"data": "custom_fields",
"createdCell": function (td, cellData, rowData, row, col) {
if (cellData !== '') {
$(td).html(cellData.replace(/,/g, ', '));
}
},
"width": "6%",
"className": "datatable-wrap"
},
{
"targets": [8],
"data": "file_size",
"createdCell": function (td, cellData, rowData, row, col) {
if (cellData !== '' && cellData !== null) {
@ -128,7 +139,7 @@ export_table_options = {
"className": "no-wrap"
},
{
"targets": [8],
"targets": [9],
"data": "complete",
"createdCell": function (td, cellData, rowData, row, col) {
if (cellData === 1 && rowData['exists']) {
@ -145,7 +156,7 @@ export_table_options = {
"className": "export_download"
},
{
"targets": [9],
"targets": [10],
"data": null,
"createdCell": function (td, cellData, rowData, row, col) {
if (rowData['complete'] !== 0) {

View file

@ -443,6 +443,7 @@ DOCUMENTATION :: END
<th align="left" id="file_format">File Format</th>
<th align="left" id="metadata_level">Metadata Level</th>
<th align="left" id="media_info_level">Media Info Level</th>
<th align="left" id="media_info_level">Custom Fields</th>
<th align="left" id="file_size">File Size</th>
<th align="left" id="complete">Download</th>
<th align="left" id="delete">Delete</th>
@ -688,6 +689,7 @@ DOCUMENTATION :: END
}
};
export_table = $('#export_table-SID-${data["section_id"]}').DataTable(export_table_options);
export_table.columns([7]).visible(false);
var colvis = new $.fn.dataTable.ColVis(export_table, { buttonText: '<i class="fa fa-columns"></i> Select columns', buttonClass: 'btn btn-dark' });
$(colvis.button()).appendTo('#button-bar-export');