1. #1
    Ext User reang's Avatar
    Join Date
    Mar 2007
    Location
    Indonesia
    Posts
    60
    Vote Rating
    0
    reang is on a distinguished road

      0  

    Default Multiple Sub Menu

    Multiple Sub Menu


    Anyone can help me....

    Please describe to me, how to make Multiple sub menu automatically with JSON...
    max level is not known.

    Thank's
    Big Regards.

  2. #2
    Sencha - Community Support Team jsakalos's Avatar
    Join Date
    Apr 2007
    Location
    Slovakia
    Posts
    27,509
    Vote Rating
    374
    jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future

      0  

    Default


    Process json in a recursive function that will create menus.

  3. #3
    Ext User reang's Avatar
    Join Date
    Mar 2007
    Location
    Indonesia
    Posts
    60
    Vote Rating
    0
    reang is on a distinguished road

      0  

    Default recursive function with JSON

    recursive function with JSON


    Anyone can give example for "recursive function" PHP-JSON?

    please help me....

  4. #4
    Sencha User
    Join Date
    Mar 2007
    Posts
    7,854
    Vote Rating
    4
    tryanDLS is on a distinguished road

      0  

    Default


    If you need to learn how to do recursion in PHP, I would think there are better places to learn than a Javascript framework forum.

  5. #5
    Sencha - Community Support Team jsakalos's Avatar
    Join Date
    Apr 2007
    Location
    Slovakia
    Posts
    27,509
    Vote Rating
    374
    jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future

      0  

    Default


    Recursive function is function that calls itself. For example:

    Code:
    function createMenu(o) {
        // do menu creation here
        if(o.submenu) {
            createMenu(o.submenu);
        }
    }
    Last edited by jsakalos; 29 Apr 2007 at 1:04 PM. Reason: corrected typo

  6. #6
    Ext User reang's Avatar
    Join Date
    Mar 2007
    Location
    Indonesia
    Posts
    60
    Vote Rating
    0
    reang is on a distinguished road

      0  

    Default


    Thank's jsakalos,

    sorry, i'm new in JS, can you explain to me for detail? and i'm not known how much the sub menu.

    Example :

    Menu 1
    > Menu 1.1
    > Menu 1.1.1
    > Menu 1.1.1.1
    > ............ (nore)
    > Menu 1.1.2
    > ............... (more)
    > Menu 1.2
    Menu 2
    Menu 3
    Menu 4
    ......... (more)

    i think, this like menu tree, but i don't know how to made it with JSON from Database.

    please help me...

    Thank's B4.
    Regards.

  7. #7
    Ext User reang's Avatar
    Join Date
    Mar 2007
    Location
    Indonesia
    Posts
    60
    Vote Rating
    0
    reang is on a distinguished road

      0  

    Default


    Thank's jsakalos,

    sorry, i'm new in JS, can you explain to me for detail? and i'm not known how much the sub menu.

    Example :

    Menu 1
    > Menu 1.1
    >> Menu 1.1.1
    >>> Menu 1.1.1.1
    >>> ............ (more)
    >> Menu 1.1.2
    >> ............... (more)
    >> Menu 1.2
    Menu 2
    Menu 3
    Menu 4
    ......... (more)

    i think, this like menu tree, but i don't know how to made it with JSON from Database.

    please help me...

    Thank's B4.
    Regards.

  8. #8
    Sencha - Community Support Team jsakalos's Avatar
    Join Date
    Apr 2007
    Location
    Slovakia
    Posts
    27,509
    Vote Rating
    374
    jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future

      0  

    Default


    Well, reading your questions it seems to me that you do NOT have troubles with javascript language but with general programming concepts and techniques.

    The best what I could suggest is to read a good book on programming basics and then a good book of OO (Object Oriented) programming basics.

    After that watch (and understand) all videos from these links:

    http://yuiblog.com/blog/2006/10/20/v...ord-domtheory/
    http://yuiblog.com/blog/2006/11/27/v...ockford-advjs/

    Good luck.

  9. #9
    Ext User reang's Avatar
    Join Date
    Mar 2007
    Location
    Indonesia
    Posts
    60
    Vote Rating
    0
    reang is on a distinguished road

      0  

    Default


    Hi jsakalos...

    i has made a Recursive menu in JSON, but i don't known how to add handler for the sub menu.

    can help me.... please....

    regards.

  10. #10
    Sencha - Community Support Team jsakalos's Avatar
    Join Date
    Apr 2007
    Location
    Slovakia
    Posts
    27,509
    Vote Rating
    374
    jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future

      0  

    Default


    See this link:

    http://extjs.com/deploy/ext/docs/output/Ext.menu.Item.html#addListener

    In your case I would recommend to have only one event hadler that would find the actual menu item clicked from the Item id.