Edit pane is now at the top of the window.
Hash map is created to keep track of rows by item ID.
This commit is contained in:
parent
74e2d5a842
commit
22d6e93478
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
<script src="editpane.js"/>
|
<script src="editpane.js"/>
|
||||||
<vbox id="appcontent">
|
<vbox id="appcontent">
|
||||||
<vbox id="editpane" hidden="true">
|
<vbox id="editpane" hidden="true" position="1">
|
||||||
<grid>
|
<grid>
|
||||||
<columns>
|
<columns>
|
||||||
<column/>
|
<column/>
|
||||||
|
|
|
@ -18,6 +18,8 @@ Scholar.TreeView.prototype.setTree = function(treebox)
|
||||||
var newRows = Scholar.Items.getTreeRows();
|
var newRows = Scholar.Items.getTreeRows();
|
||||||
for(var i = 0; i < newRows.length; i++)
|
for(var i = 0; i < newRows.length; i++)
|
||||||
this._showItem(newRows[i], 0, i+1); //item ref, isContainerOpen, level
|
this._showItem(newRows[i], 0, i+1); //item ref, isContainerOpen, level
|
||||||
|
|
||||||
|
this._refreshHashMap();
|
||||||
}
|
}
|
||||||
|
|
||||||
Scholar.TreeView.prototype.getCellText = function(row, column)
|
Scholar.TreeView.prototype.getCellText = function(row, column)
|
||||||
|
@ -97,6 +99,7 @@ Scholar.TreeView.prototype.toggleOpenState = function(row)
|
||||||
this._treebox.rowCountChanged(row+1, count); //tell treebox to repaint these
|
this._treebox.rowCountChanged(row+1, count); //tell treebox to repaint these
|
||||||
this._treebox.invalidateRow(row);
|
this._treebox.invalidateRow(row);
|
||||||
this._treebox.endUpdateBatch();
|
this._treebox.endUpdateBatch();
|
||||||
|
this._refreshHashMap();
|
||||||
}
|
}
|
||||||
|
|
||||||
Scholar.TreeView.prototype.selectionChanged = function()
|
Scholar.TreeView.prototype.selectionChanged = function()
|
||||||
|
@ -170,6 +173,27 @@ Scholar.TreeView.prototype.deleteSelection = function()
|
||||||
this._treebox.rowCountChanged(rows[i]-i, -1);
|
this._treebox.rowCountChanged(rows[i]-i, -1);
|
||||||
}
|
}
|
||||||
this._treebox.endUpdateBatch();
|
this._treebox.endUpdateBatch();
|
||||||
|
|
||||||
|
this._refreshHashMap();
|
||||||
|
}
|
||||||
|
|
||||||
|
Scholar.TreeView.prototype._refreshHashMap = function()
|
||||||
|
{
|
||||||
|
// Create hash map of folder and object ids to row indexes
|
||||||
|
// Author: Dan Stillman
|
||||||
|
|
||||||
|
this._itemRowMap = new Array();
|
||||||
|
this._folderRowMap = new Array();
|
||||||
|
for(var i=0; i < this.rowCount; i++){
|
||||||
|
if (this.isContainer(i)){
|
||||||
|
this._folderRowMap[this._getItemAtRow(i).getID()] = i;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
this._itemRowMap[this._getItemAtRow(i).getID()] = i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//Scholar.debug(Scholar.varDump(this.folderRowMap));
|
||||||
|
//Scholar.debug(Scholar.varDump(this.objectRowMap));
|
||||||
|
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in New Issue
Block a user