Chris - 2013-06-07

hi.. how do i sort the client list (on the clock popup) by alphabetical order instead of it being sorted by which clientID was created first? something with the javascript?

function getInitialClient() {
for (clientKey in clientProjectsHash) {
if(clientKey > 0) {
return clientKey;
}
}
}

or

function populateClientSelect(selectedClientId) {
//get the client select
var clientSelect = document.getElementById('clientSelect');

    //clientSelect.options[clientSelect.options.length] = new Option("All Clients", 0);

    //add the clients
    for (clientKey in clientProjectsHash) {
        //alert("client:" + clientKey + ", name: " + clientProjectsHash[clientKey].name);
        clientSelect.options[clientSelect.options.length] = new Option(clientProjectsHash[clientKey].name, clientKey);

        if(selectedClientId == undefined || selectedClientId == 0) {
            if(clientKey > 0) {
                selectedClientId=clientKey;
            }
        }

        if (clientKey == selectedClientId)
            clientSelect.options[clientSelect.options.length-1].selected = true;
    }
}