playlists_table_options = { "destroy": true, "language": { "search": "Search: ", "lengthMenu": "Show _MENU_ entries per page", "info": "Showing _START_ to _END_ of _TOTAL_ playlists", "infoEmpty": "Showing 0 to 0 of 0 entries", "infoFiltered": "", "emptyTable": "No data in table", "loadingRecords": ' Loading items...' }, "pagingType": "full_numbers", "stateSave": true, "stateSaveParams": function (settings, data) { data.search.search = ""; data.start = 0; }, "stateDuration": 0, "processing": false, "serverSide": true, "pageLength": 25, "order": [0, 'asc'], "autoWidth": false, "scrollX": true, "columnDefs": [ { "targets": [0], "data": "title", "createdCell": function (td, cellData, rowData, row, col) { if (cellData !== '') { var smart = ''; if (rowData['smart']) { smart = ' ' } var breadcrumb = ''; if (rowData['userID']) { breadcrumb = '&user_id=' + rowData['userID']; } else if (rowData['librarySectionID']) { breadcrumb = '§ion_id=' + rowData['librarySectionID']; } var thumb_popover = '' + cellData + ''; $(td).html(smart + '' + thumb_popover + ''); } }, "width": "60%", "className": "no-wrap" }, { "targets": [1], "data": "leafCount", "createdCell": function (td, cellData, rowData, row, col) { if (cellData !== '') { var type = MEDIA_TYPE_HEADERS[rowData['playlistType']] || ''; if (rowData['leafCount'] === 1) { type = type.slice(0, -1); } $(td).html(cellData + ' ' + type); } }, "width": "20%", "className": "no-wrap" }, { "targets": [2], "data": "duration", "createdCell": function (td, cellData, rowData, row, col) { if (cellData !== '') { $(td).html(humanDuration(cellData, 'dhm')); } }, "width": "20%", "className": "no-wrap" } ], "drawCallback": function (settings) { // Jump to top of page //$('html,body').scrollTop(0); $('#ajaxMsg').fadeOut(); // Create the tooltips. $('body').tooltip({ selector: '[data-toggle="tooltip"]', container: 'body' }); $('body').popover({ selector: '[data-toggle="popover"]', html: true, sanitize: false, container: 'body', trigger: 'hover', placement: 'right', template: '', content: function () { return '
'; } }); }, "preDrawCallback": function(settings) { var msg = "  Fetching rows..."; showMsg(msg, false, false, 0); $('[data-toggle="tooltip"]').tooltip('destroy'); }, "rowCallback": function (row, rowData, rowIndex) { } };