PDA

View Full Version : [CLOSED] Generate Toolbar with menu from XML



ucaneto
Jul 29, 2014, 5:47 PM
Hello All


Is to generate a toolbar menu reading a xml file? Does anyone have an example?


thank

Vladimir
Jul 29, 2014, 6:15 PM
Hi

What exactly problems do you have? Just read your XML, extract required elements and create widgets according XML data
If you have any problems with it then please describe each issue and we will be happy to help you

ucaneto
Jul 29, 2014, 6:52 PM
Thanks for the quick response, my question is


I can read the XML, what I'm doing is not getting the menu or splitbutton with sublevels


ex:




SplitButton1 SplitButton2
+ Lv 1 .....
+ Level 1.1
+ Level 1.2
Level 2 +
Level 3 +
+ Level 3.1

My example XML is


<?xml version="1.0" encoding="utf-8" ?>
<menu>
'Level 0 nodes
<menuitem root="" name="Search Sites" menuid="1" />
<menuitem root="" name="Webmail Sites" menuid="2" />
<menuitem root="" name="DotNet Sites" menuid="3" />

'Level 1 Items
<menuitem root="1" name="Google" url="http://www.google.com" menuid="11"/>
<menuitem root="1" name="Altavista" url="http://www.Altavista.com" menuid="12"/>

'Level 1 Items
<menuitem root="2" name="Hot-mail" url="" menuid="21"/>
'Level 2 Items
<menuitem root="21" name="Hotmail" url="http://www.hotmail.com" menuid="211"/>
<menuitem root="21" name="MSN" url="http://www.MSN.com" menuid="212"/>

<menuitem root="2" name="Yahoo" url="http://www.yahoo.com" menuid="22"/>
<menuitem root="2" name="Rediff" url="http://www.rediff.com" menuid="23"/>

'Level 1 Items
<menuitem root="3" name="Microsoft" url="http://www.Microsoft.com" menuid="31"/>
<menuitem root="3" name="GotDotNet" url="http://www.GotDotNet.com" menuid="32"/>
<menuitem root="3" name="CodeProject" url="http://www.CodeProject.com" menuid="33"/>
<menuitem root="3" name="ASpdotnet" url="http://www.ASpdotnet.com" menuid="34"/>

</menu>

Vladimir
Jul 29, 2014, 7:01 PM
Can you demonstrate how do you build menu or splitbutton?

ucaneto
Jul 29, 2014, 8:39 PM
Hello


It can be anything like the Post http://forums.ext.net/showthread.php?14781-CLOSED-Generate-Toolbar-with-menu-from-Web-sitemap-xml only reading an XML and not a sitemap.xml




I thank you for your attention to me.

geoffrey.mcgill
Jul 29, 2014, 11:16 PM
The thread you linked to above should help get you started.

Using nodes of an Xml document to build an Ext.NET Menu component is not an Ext.NET specific problem, so we cannot provide much assistance.

You could try building a series of nested unordered lists <ul> if you're having trouble traversing your Xml file. Once you get that working porting to MenuItems should be simple.

ucaneto
Jul 29, 2014, 11:41 PM
Thank you.


I would appreciate if any forum member can help me in this topic, if you have already used the xml or database to assemble a menu of this type.

geoffrey.mcgill
Jul 29, 2014, 11:49 PM
Please feel free to post your general ASP.NET questions at StackOverflow (http://stackoverflow.com).