Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • mico 10 posts 30 karma points
    Jun 29, 2014 @ 19:52
    mico
    0

    How to expand all items in main content tree when loading page

    Well, I have tried many different variants of my own solutions but all of them failed/did not fetch all nodes correctly. was wondering if anyone was trying to expand all the items when the page is loaded?

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Jun 29, 2014 @ 20:26
    Jan Skovgaard
    0

    Hi Mico

    What version of Umbraco are you using? And is it safe to assume you have tried doing something in the backoffice rather then on the frontend part of the website?

    /Jan

  • mico 10 posts 30 karma points
    Jun 29, 2014 @ 20:30
    mico
    0

    I'm sorry i didn't mention, I'm using version 6.1.6.

    What iv'e mostly tried was related to the file umbraco_client\Tree\UmbracoTree.js.
    I tried to add my own code into there, which mostly fetch only the first level, and also changing the tree's object settings.
    both ways didn't work for me. 

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Jun 29, 2014 @ 20:35
    Jan Skovgaard
    0

    Hi Mico

    Ok - Not sure I know how to point you in the right direction but perhaps others coming across this post could benefit from seeing some of the code you have tried adding/modifying in the mentioned file if you don't mind sharing it.

    Cheers, Jan

  • mico 10 posts 30 karma points
    Jun 29, 2014 @ 20:42
    mico
    0

    Sure, here's my code:

    var clickedItems = 999;  
    function expandNodesInCurrentLevel() {
    var c = $('.closed.loaded').click();
    clickedItems = c.length;
    }

    $(function() {
    //First attempt
    while (clickedItems != 0) {
    expandNodesInCurrentLevel();
    }

    //Second attempt
    for (var i = 0; i < 10; i++) {
    expandNodesInCurrentLevel();
    }
    });
    now, assume i have 4 levels, if u call the function expandNodesInCurrentLevel FOUR TIMES it will expand all these levels.
Please Sign in or register to post replies

Write your reply to:

Draft