Ignore case on sorting.

This commit is contained in:
David Norton 2006-06-20 14:36:49 +00:00
parent 5af10b1061
commit 8f38c09c2e

View File

@ -249,7 +249,16 @@ Scholar.ItemTreeView.prototype.sort = function()
{ {
function columnSort(a,b) function columnSort(a,b)
{ {
return (a.getField(column.id) > b.getField(column.id)) ? -1 : (a.getField(column.id) < b.getField(column.id)) ? 1 : 0; var fieldA = a.getField(column.id);
var fieldB = b.getField(column.id);
if(typeof fieldA == 'string')
{
fieldA = fieldA.toLowerCase();
fieldB = fieldB.toLowerCase();
}
return (fieldA > fieldB) ? -1 : (fieldA < fieldB) ? 1 : 0;
} }
} }