Alphabetically sort Scheduled jobs and tools in the Episerver 10.2.0.0

Vote:
 

Hi Everyone,

We are using Episerver 10.2.0.0 for our website and currently all the scheduled jobs and tools are not sorted. we wanted to know how we can alphabetically sort scheduled jobs and tools displayed in Admin mode. 

Also we are using "Scheduled Job Overview" in our solution in which you can see the scheduled jobs are already sorted. The same fuctionality we want under Admin mode=>Scheduled Jobs and Admin mode=>Tools

BR,

Priti

#176730
Mar 24, 2017 10:10
Vote:
 

Hi Everyone,

Any suggestion on this...

Thank you in advance.

BR,

Priti

#176925
Mar 30, 2017 7:50
Vote:
 

I am wondering the same thing. We have many scheduled jobs, and it would be great to be able to order them in some way.

#187632
Jan 30, 2018 13:01
Vote:
 

All custom scheduled jobs and tools can be ordered by setting the SortIndex property on respective attribute.

(Defined on PlugInAttribute that ScheduledPlugInAttribute among others inherits.)

#187640
Jan 30, 2018 15:16
Vote:
 

To simply modify the Job sort order in the Epi admin screen, here is a simple client side hack.

Response to this thread by Dung Nguyen, gives us an way to inject JS into the admins screen.

https://world.episerver.com/forum/developer-forum/-Episerver-75-CMS/Thread-Container/2015/5/inject-jscss-into-cms-edit-view/

We can modify the DOM to sort the jobs list from there. Tested against v11.14

function sortUnorderedList(ulIdentifier) {
    var list = document.getElementById(ulIdentifier);
    if (list === null) {
        return;
    }
        
    var items = list.children;
    var sortedList = Array.from(items).sort(function (x, y) {
        if (x.getElementsByTagName("a")[0].textContent < y.getElementsByTagName("a")[0].textContent) {
            return -1;
        }
        if (x.getElementsByTagName("a")[0].textContent > y.getElementsByTagName("a")[0].textContent) {
            return 1;
        }
        return 0;
    });

    sortedList.forEach(function (content, index) {
        list.appendChild(content);
    });

}

document.addEventListener("DOMContentLoaded", function () {
    sortUnorderedList("admin_scheduledJobs_sub");
}, false);
#219166
Edited, Mar 30, 2020 17:02
This thread is locked and should be used for reference only.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.