Object pane now shows creators=

This commit is contained in:
David Norton 2006-03-21 14:58:40 +00:00
parent b50afbef24
commit 7448c8ce5d

View file

@ -5,7 +5,8 @@ var treeView = {
dataObjects: null, dataObjects: null,
get rowCount() { return this.dataObjects.length; }, get rowCount() { return this.dataObjects.length; },
getCellText: function(row,column){ getCellText: function(row,column)
{
obj = this.dataObjects[row]; obj = this.dataObjects[row];
if(column.id == "title_column") if(column.id == "title_column")
@ -21,7 +22,8 @@ var treeView = {
return obj.getField("source"); return obj.getField("source");
} }
}, },
setTree: function(treebox){ setTree: function(treebox)
{
this.treebox = treebox; this.treebox = treebox;
this.dataObjects = Scholar.Objects.getAll(); this.dataObjects = Scholar.Objects.getAll();
}, },
@ -33,7 +35,8 @@ var treeView = {
getRowProperties: function(row,props){}, getRowProperties: function(row,props){},
getCellProperties: function(row,col,props){}, getCellProperties: function(row,col,props){},
getColumnProperties: function(colid,col,props){}, getColumnProperties: function(colid,col,props){},
selectionChanged: function(){ selectionChanged: function()
{
if(this.selection.count == 0) if(this.selection.count == 0)
{ {
document.getElementById('status-text').value = "(No selection)"; document.getElementById('status-text').value = "(No selection)";
@ -80,13 +83,35 @@ function populateObjectPane(objectRow)
valueElement.appendChild(document.createTextNode(objectRow.getField(fieldNames[i]))); valueElement.appendChild(document.createTextNode(objectRow.getField(fieldNames[i])));
var row = document.createElement("row"); var row = document.createElement("row");
row.appendChild(label) row.appendChild(label);
row.appendChild(valueElement) row.appendChild(valueElement);
row.setAttribute("id","dynamic-"+fieldNames[i]);
dynamicBox.appendChild(row); dynamicBox.appendChild(row);
} }
} }
var beforeField = document.getElementById('dynamic-title');
beforeField = beforeField.nextSibling;
for (var i=0,len=objectRow.numCreators(); i<len; i++)
{
var creator = objectRow.getCreator(i);
var label = document.createElement("label");
label.setAttribute("value","Creator:");
var valueElement = document.createElement("description");
valueElement.appendChild(document.createTextNode(creator.lastName+", "+creator.firstName));
var row = document.createElement("row");
row.appendChild(label);
row.appendChild(valueElement);
dynamicBox.insertBefore(row, beforeField);
}
} }
function selectionChanged() function selectionChanged()