Results 1 to 3 of 3

Thread: create Menu and Sub menu recursively in Extjs

  1. #1
    Sencha User
    Join Date
    Oct 2015
    Posts
    15

    Default create Menu and Sub menu recursively in Extjs

    0down votefavorite
    Is there way i can create Menu and Submenu recursivesly like tree node creation in Treepanel Extjs
    Say i have empty menu items
    I read xml input for constructing a Menu and Submenu
    my xml look like


    Is there way i can create Menu and Submenu recursivesly like tree node creation in Treepanel Extjs


    Say i have empty menu items


    I read xml input for constructing a Menu and Submenu


    my xml look like


    <r>
    <sub>
    <sub1>
    <sub 1.1/>
    <sub 1.1.1/>
    </sub1>
    <sub2/>
    <sub3>
    <sub 3.1>
    <sub 3.1.1>
    </sub3>
    </r>


    xml may go any depth ,please provide suggestion

  2. #2
    Sencha User
    Join Date
    Feb 2013
    Location
    California
    Posts
    11,985

    Default

    There's nothing build into Ext JS 3 that will create a menu from XML.

  3. #3
    Sencha User
    Join Date
    Oct 2015
    Posts
    15

    Default Is there way i can create Menu and Submenu recursivesly like tree node creation

    Quote Originally Posted by Gary Schlosberg View Post
    There's nothing build into Ext JS 3 that will create a menu from XML.

    Thanks for your reply Gary Schlosberg, by the way can you help me out how to achieve thus,

    i have splitbutton with menu configured as empty array

    xtype: "splitbutton",
    //text: 'FAQ',
    tooltip:'Help',
    enableToggle:true,
    iconCls : 'help-btn',
    hidden: Ext.DomQuery.jsSelect("MENU/ITEM", me.xml).length>=1?false:true,
    menu:[],
    listeners : {
    arrowclick : function () {
    var Menunode = Ext.DomQuery.selectNode('MENU',me.xml);
    if(this.menu.items.length==0)
    this.ownerCt.renderMenu(Menunode,this.menu)
    this.menu.showAt(this.getX(),this.getY()*4);

    }


    when user click arrow i am planning build menu by follwing xml

    <MENU>
    <ITEM LABEL="FAQ" URL="" clsName="user_guide" HIDDEN='false' handler='newWindow'/>
    <ITEM LABEL="Key Contact Information" URL="" clsName="faq-btn" HIDDEN='false' handler='null'>
    <ITEM LABEL="someLabel" URL="someURL handler usd to open" clsName="faq-btn" HIDDEN='false' handler='emailHandler'>
    <ITEM LABEL="abc" URL="aa" clsName="faq-btn" HIDDEN='false' handler='emailHandler'/>
    </ITEM>
    </ITEM>
    <ITEM LABEL="Training Materials" URL="someURL handler usd to open" clsName="trMaterial" HIDDEN='false' handler='null'>
    <ITEM LABEL="System " URL="someURL handler usd to open" clsName="faq-btn" HIDDEN='false' handler='newWindow'/>
    <ITEM LABEL="Data " URL="someURL handler usd to open" clsName="faq-btn" HIDDEN='false' handler='newWindow'/>
    </ITEM>
    </MENU>


    where item can be go any depth, i have recursively traverse menu-->item,item-->item if any like that,
    if single item it will added to empty menu Array []

    else
    it will be recursively passed in function at end once all levels passed new item will be added into menu

    Thanks in Advance

Similar Threads

  1. Replies: 2
    Last Post: 7 Dec 2015, 4:04 PM
  2. A extjs.menu.menu to create problems
    By iMr_leung in forum Ext: Q&A
    Replies: 4
    Last Post: 3 Jun 2015, 4:57 AM
  3. Create a toolbar menu that use coldfusion/extjs page
    By marxan in forum Ext 3.x: Help & Discussion
    Replies: 4
    Last Post: 6 Dec 2010, 10:56 AM
  4. Create Ext.menu.Menu on Panel
    By ornanong_o in forum Ext 3.x: Help & Discussion
    Replies: 0
    Last Post: 18 Nov 2010, 2:39 AM
  5. Replies: 5
    Last Post: 18 Feb 2009, 7:57 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •