Re: Trees in Tabs?

reverendlinux <[email protected]>
Newsgroups gmane.comp.mozilla.devel.xpfe
Organization http://groups.google.com
Message-ID <537446d0-f7b8-4fec-977a-09378d348af2@f11g2000vbm.googlegroups.com>
On Sep 12, 10:45 am, reverendlinux <[email protected]>
wrote:
> On Sep 12, 9:05 am, Igor Tandetnik <[email protected]> wrote:
>
>
>
>
>
>
>
>
>
> > On 9/11/2011 12:34 PM, reverendlinux wrote:
>
> > > In pre-planning a XUL utility (for personal use), I hit on the idea of
> > > having multiple tabs with trees in that are populated by Javascript.
> > > Before I start my coding, I'd like to know is this possible?  If so,
> > > is there anything special beyond building it like
>
> > > <tab>
> > >        <tree>
> > >              ...stuff in tree...
> > >        </tree>
> > > </tab>
>
> > You probably want your tree in a <tabpanel>, not a <tab>. <tab>
> > represents the little tag at the top that you click to switch tabs.
> > --
> > Igor Tandetnik
>
> Thanks, Igor!
>
> I've now gotten the rough draft of my tabs/trees laid out.  As I
> approached writing the Javascript for populating the tree, I was
> wondering if there were any nuances that others may know of.  Just to
> make the chore a bit easier.

I'm revisiting this one because I've come to a complete road block
when trying to populate trees within tabs

I have series of tabs that each have a tree in them.  The data I want
to put in each of the tabs is contained within an array.  When I try
to populate the trees with the data from the arrays, nothing is
displayed.  I get no errors in -jsconcole (no surprise there) or when
using try { ... } catch (e).

Here is the basic code that I am using to populate the tree.  The
array is called filtered and contains my data in tab seperated value
format.  tabName is a variable containing the id of the tab that I am
trying to populate.

   ... code to populate the array filtered and the variable tabName
executes ...

	var treeView = {
		rowCount : filtered.length,
		getCellText : function(row,column) {
			if (filtered[row]) {
       				var line = filtered[row].split("\t");
				switch (column.id) {
					case "title":
						return line[0];
					case "issue":
						return line[1];
					case "date":
						return line[2];
					default :
						return false;
						    } // end switch
  					   } // end if filtered
    						   },
    		setTree: function(treebox){ this.treebox = treebox; },
    		isContainer: function(row){ return false; },
    		isSeparator: function(row){ return false; },
    		isSorted: function(){ return false; },
    		getLevel: function(row){ return 0; },
    		getImageSrc: function(row,col){ return null; },
    		getRowProperties: function(row,props){},
    		getCellProperties: function(row,col,props){},
    		getColumnProperties: function(colid,col,props){}
	};

	document.getElementById(tabName).view = treeView;

So my question is, am I missing something in this code that is causing
the data to not be displayed?
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.