Add sorting on address book columns

This commit is contained in:
chuang%netscape.com 1999-08-19 20:12:19 +00:00
Родитель c0b9d968ca
Коммит fd6853ad8c
2 изменённых файлов: 39 добавлений и 3 удалений

Просмотреть файл

@ -140,3 +140,39 @@ function ResultsPaneSelectionChange()
}
}
function SortResultPane(column, sortKey)
{
var node = document.getElementById(column);
if(!node)
return false;
var rdfCore = XPAppCoresManager.Find("RDFCore");
if (!rdfCore)
{
rdfCore = new RDFCore();
if (!rdfCore)
{
return(false);
}
rdfCore.Init("RDFCore");
}
// sort!!!
sortDirection = "ascending";
var currentDirection = node.getAttribute('sortDirection');
if (currentDirection == "ascending")
sortDirection = "descending";
else if (currentDirection == "descending")
sortDirection = "ascending";
else sortDirection = "ascending";
rdfCore.doSort(node, sortKey, sortDirection);
return(true);
}

Просмотреть файл

@ -63,9 +63,9 @@ Rights Reserved.
<treehead>
<treerow>
<treecell>&nameColumn.label;</treecell>
<treecell>&emailColumn.label;</treecell>
<treecell>&phoneColumn.label;</treecell>
<treecell onclick="return top.SortResultPane('NameColumn', 'http://home.netscape.com/NC-rdf#DisplayName');">&nameColumn.label;</treecell>
<treecell onclick="return top.SortResultPane('EmailColumn', 'http://home.netscape.com/NC-rdf#PrimaryEmail');">&emailColumn.label;</treecell>
<treecell onclick="return top.SortResultPane('WorkPhoneColumn', 'http://home.netscape.com/NC-rdf#WorkPhone');">&phoneColumn.label;</treecell>
</treerow>
</treehead>