XulPlanet Forum

The place to talk about XUL

 FAQ   Search   Memberlist   Usergroups   Register 
 Profile   Log in to check your private messages   Log in 

Problem with tree twistys in custom tree view

 
       XulPlanet Forum Index -> XUL
View previous topic :: View next topic  
Author Message
C0USTEAU



Joined: 08 Nov 2005
Posts: 3

Posted: Tue Nov 08, 2005 5:33 pm    Post subject: Problem with tree twistys in custom tree view

Hi all,

I've created a page very similar to the tutorial example at this link:

http://xulplanet.com/tutorials/xultu/treeviewdet.html

I'm having a problem with the twistys, namely that clicking on them has no effect. I get the desired result by calling my toggleOpenState function directly, but nothing happens when the twisty is clicked. What do I need to do to have the toggleOpenState function called when a twisty is clicked?

Sorry if this question has been handled previously, I searched the forum but couldn't find a working solution. Thanks for any help.
Back to top
C0USTEAU



Joined: 08 Nov 2005
Posts: 3

Posted: Thu Nov 10, 2005 5:09 pm    Post subject:

I figured it out.

For anybody else who had the same issue, add the following to the treeView definition:

Code:

  QueryInterface : function(aIID)
  {
    if (Components.interfaces.nsIClassInfo.equals(aIID) ||
        Components.interfaces.nsITreeView.equals(aIID) ||
        Components.interfaces.nsISupportsWeakReference.equals(aIID) ||
        Components.interfaces.nsISupports.equals(aIID))
    {
      return this;
    }
    throw 0x80004002; // Components.results.NS_NOINTERFACE;
  },     

  get flags() { return Components.interfaces.nsIClassInfo.DOM_OBJECT; }, 


The twistys should now function correctly

~Feargal Egan
Back to top
Display posts from previous:   
       XulPlanet Forum Index -> XUL All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Copyright © 1999-2006 XULPlanet.com