Using a TreeView in a module

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

Please do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.

This forum is for discussing mojoPortal development

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

You can monitor commits to the repository from this page. We also recommend developers to subscribe to email notifications in the developer forum as occasionally important things are announced.

Before posting questions here you might want to review the developer documentation.

Do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.
This thread is closed to new posts. You must sign in to post in the forums.
9/14/2006 11:20:22 AM
Gravatar
Total Posts 5

Using a TreeView in a module

I'm trying to use a Treeview in a module that I am building. The module compiles and displays the treeview but the treeview loses all of its built in functionality - ability to collapse and expand etc. It just basically displays as a set of nested unordered lists.

I see there is a TreeViewAdapter class in mojoPortal (I'm working with the 2.1 branch in SVN) but I'm not sure what I do with that or if that has anything to do with using a TreeView in my module?

Any tips would be most appreciated.

Thanks

Sean

9/14/2006 3:46:55 PM
Gravatar
Total Posts 18439

Re: Using a TreeView in a module

Hey Sean,

Yes the reason is we are using the CSS Adapters from here. Actually they recently released an update and it may have more support for the regular treeview features even with the ul/li rendering, but I haven't updated it in mojoPortal yet

If you look in App_Browsers/CssFriendlyAdapters.browser and you remove or comment out this line everywhere you see it:

<adapter controlType="System.Web.UI.WebControls.TreeView"
               adapterType="mojoPortal.Web.TreeViewAdapter" />

It should go back to the default treeview behavior and work as you expect. We aren't currently using the treeview anywhere in mojoPortal so it won't hurt anything. I do plan to make a sample skin using the Treeview for the menu at some point and I want ul and li elements to be rendered for that so I will use the adapter in the future.
But to leave it up to the developer I'm going to make a subclass of treeview and hookup the adapter to work with it so I can leave the regular treeview with its default features and I'll use this subclass in the treeview menu.


Joe
4/25/2007 4:19:31 AM
Gravatar
Total Posts 11

Re: Using a TreeView in a module

Need help as the tree view is not rendered correctly...

it renders it as html tables with rows and columns and with borders which dosent make the look and feel very appealing...

is there any way to simply render a tree view as <ui> in the app or where would i have to modify the code to do the same....

i am specificially tyalking about a left hand side menu on my site.

<!-- changed the value of ShowMenu to false and ShowTreeView=true -->
<div id="treemenu">
<portal:SiteMenu id="SiteMenu1" runat="server"
ShowMenu="False"
ShowTreeView="True"
Direction="Vertical">
</portal:SiteMenu>
</div>

 

content rendered is rendered as a table with thick black borders...

 

any help would be much appreciated...thanks a ton

4/25/2007 6:56:25 AM
Gravatar
Total Posts 18439

Re: Using a TreeView in a module

Hi,

Sorry I admit, the "ShowTreeView" option is unfinished work. I need to finish hooking up the CSS Adpater from here:
http://www.asp.net/CSSAdapters/TreeView.aspx

and then I need to add some css classes to the skins.

I'm looking at it now and should have the code checked in to svn branches/2.x later today for hooking up the adapter.

If you can checkout from svn you can get this right away but you might need to do your own css styling by looking at the documentation at the above link. That takes a bit longer and I'm not sure I'll get to it today.

Thanks,

Joe

4/25/2007 7:08:34 AM
Gravatar
Total Posts 11

Re: Using a TreeView in a module

 Thanks alot will check that link out.

--

Aaron.

4/25/2007 8:50:12 AM
Gravatar
Total Posts 11

Re: Using a TreeView in a module

 the rendering of the tree view is abit out of shape and the text of the sub nodes appear to be as if they were justified....

also if i wanted any changes in the text or rendering of the submenus, for example i want the sub nodes to have a smaller font...where exactly would i have to define these values.

 

 

 

4/25/2007 4:03:50 PM
Gravatar
Total Posts 18439

Re: Using a TreeView in a module

If you build the code from a fresh update of svn branches/2.x the ShowTreeView option now works quite a bit better. You may still want to tweak the css but its reasonable as is.

Thanks,

Joe

4/26/2007 12:02:57 PM
Gravatar
Total Posts 23

Re: Using a TreeView in a module

I am using a previous build of mojo.

The tree view is working file although the alignment of the menus is not working.

 

Let me be specific...

My submenus have long text so when they expand it cause the content in the center of the page to get shifted to the right. For Menu items with sub menu items with short text, it works fine..how ever menu items with long sub menu items text cause the center content to work.

Is there any way that i can speciy that if the submenu content is going beyond a certain level i should perform some sort of word wrapping...or specify somwehere in the css a word wrap...

I guess if i sent you a screen shot it would be helpful, please let me know...thank you.

 

Aaron.

4/26/2007 1:37:11 PM
Gravatar
Total Posts 18439

Re: Using a TreeView in a module

Hi Aaron,

Any previous build does not have correct code so I would really urge you to get the latest svn brasnches/2.x using TortoiseSVN

When I implemented this yesterday, I noticed that the previous implementation was not filtering the menu by role so even when logged out the admin section of the menu was displayed.

Also the previous implementation was using asp:Treeview which is not hooked up to the control adapter and therefore renders as tables. The current implementation uses mojoTreeView which inherits from asp Treeview but hooks up the css adapter to render as ul and li rather than tables.

I also added css classes to the style sheets for the existing skins for the treeview using the css adapter so any css solution  I can come up with will be based on th css classes used in the adapter.

I'm looking into simulating the layout issue from your screen shot now but any solution I come up with will certainly be for the newer code and dependent on the css classes used by the adapter

I'll post more after I've had a chance to look further.

Thanks,

Joe

4/26/2007 2:26:56 PM
Gravatar
Total Posts 18439

Re: Using a TreeView in a module

Ok, I was able to produce a similar problem using the latest code.

Symptom:

CSS causing this in style.css:

Fix is to remove the white-space:nowrap

Fixed Screenshot:

Again this solution works with the latest svn only.

Hope it helps,

Joe

4/26/2007 2:41:18 PM
Gravatar
Total Posts 23

Re: Using a TreeView in a module

I have sorted out the issue by using an already existing feature of the treeview class...in the old build...the text wrapping of menu sub nodes is working fine with the tree view.

I haven't yet checked the bug which you have pointed out, the admin menu being visible after logging out. I am really looking into implementing the newer releases for my organization...however since we have already made many changes and added many of our own custom controls...and have implemented many specific changes as a part of an ongoing customization process...i am a little worried about the team having to do rework...

Is there any way that I could use only certain changes in the new build and keep our the current version that we are working on intact...for example in this case how would i implement the the new tree view functinality without affecting the working of our current build.

The files that would be affected i am guessing would be

1) sitemenu.ascx,2) styles.css(more css classes) 3) the menu adapters and the 4) treeview adapters(.cs files)

and probably the tree view class as it would have some new functionality.

Once again, you have really been of help and i really appreciate the quick and accurate  replies to my queries...

 

thanks a ton Joe.

 

Aaron

You must sign in to post in the forums. This thread is closed to new posts.