Thank you Will!
As far as I understand, what you suggested doesn't necessarily solve my problem of not being able to add a new column to the pane -- although I need to look invest more time looking into this.
So for now I followed your advice patching getCellText() to do what I need and simply hijack the Extra column for my extension-specific output.
What I'm doing now is:
var getCellTextOld = Zotero.ItemTreeView.prototype.getCellText;
Zotero.ItemTreeView.prototype.getCellText = function(row,column){
if (
column.id != "zotero-items-column-extra")
{
return getCellTextOld.apply(getCellTextOld, [row, column]);
}
else
{
return -99;
}
}
This works to the extend that my extension now fills in the Extra column with "-99" for all items in my library (very useful, I know).
However, calls to the original getCellText() fail with this error message -- leaving the corresponding columns blank:
Error: TypeError: this._getItemAtRow is not a function
Source File: chrome://zotero/content/xpcom/itemTreeView.js
Line: 919
As far as I understand, getCellText() is called on objects of the Tree View type, i.e. something of the sort of "tree.view.getCellText(...)" where "tree" has the appropriate type.
So I am guessing that when overriding getCellText() as I do above I am messing something up about the "this" reference.
Anyone have an idea of how to fix this?