Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to add row to Tree? (Noob)

21 views
Skip to first unread message

kherge

unread,
Mar 4, 2008, 3:06:56 PM3/4/08
to
I'm a beginner at developing Firefox extensions (2.0+).

I'm looked through the MDC Wiki and XulPlanet but I cannot find any
clear method of adding rows to an existing tree.

How would I accomplish this?

Igor Tandetnik

unread,
Mar 4, 2008, 3:44:11 PM3/4/08
to
kherge <khe...@gmail.com> wrote:
> I'm looked through the MDC Wiki and XulPlanet but I cannot find any
> clear method of adding rows to an existing tree.

What is the tree backed by - explicit <treeitem> elements, RDF dataset,
or custom nsITreeView implementation? In the first case, you simply
insert more <treeitem> elements into the DOM (see e.g. appendChild). In
the second, you need to update the underlying RDF dataset, and rebuild.
In the third, you call nsITreeBoxObject::rowCountChanged on the tree's
box object, and it will turn around and query your nsITreeView
implementation for information about new rows.

Igor Tandetnik


Neil

unread,
Mar 5, 2008, 6:43:41 AM3/5/08
to
Igor Tandetnik wrote:

>In the second, you need to update the underlying RDF dataset, and rebuild.
>

Assuming a correctly implemented RDF data source, it will automatically
notify the tree of the updates.

--
Warning: May contain traces of nuts.

Neil

unread,
Mar 5, 2008, 6:45:06 AM3/5/08
to
Neil wrote:

> Igor Tandetnik wrote:
>
>> In the second, you need to update the underlying RDF dataset, and
>> rebuild.
>
> Assuming a correctly implemented RDF data source, it will
> automatically notify the tree of the updates.

Ah, maybe you're thinking of the case where you update the source XML
and refresh the RDF, which does need a rebuild.

0 new messages