[Project_owners] Changing contents of a tree cell

Michael Vincent van Rantwijk mv_van_rantwijk at SPAMFREEyahoo.com
Tue Jun 7 12:29:02 EDT 2005


Wladimir Palant wrote:

> David Murray wrote:
> 
>> I can't figure out how to do this. I thought tree.view.setCellText() 
>> would, but it seems to do nothing at all, and returns no errors.
> 
> 
> This one is usually not implemented, it isn't used by the tree yet.

It depents on the tree/datasource but try this:

columnID = "Name";
columnID = ('columns' in tree) ? tree.columns[columnID] : columnID;
tree.builderView.setCellText(row, columnID, data);

Michael.

>> Is there anyway to do this properly, or should I just resort to poking 
>> in the DOM?
> 
> 
> Yes, if your data is in the DOM. If you use RDF, then you have to change 
> it in the datasource.
> 
> Wladimir

...and you can do that like this:

const _RDF = Components.classes[ "@mozilla.org/rdf/rdf-service;1" 
].getService( Components.interfaces.nsIRDFService );
dataSource.Change(_RDF.GetResource(aResource), property, currentValue, 
newValue);

FYI: property is something like: "http://www.foo.bar/rdf#whatever";

Michael.


More information about the Project_owners mailing list