AnsweredAssumed Answered

Custom document Library Action with Tree

Question asked by thestorm on Feb 14, 2014
Dear all,

we try to create a custom doclib actions (type="javascript") and from that javascript we want to call a widget/modal/dialog whatever that contains an Alfresco.RepositoryDocListTree

We tried to create a YAHOO.widget.SimpleDialog and add the RepoTree to its body but that simply doesnt render for us. Our code is below. Would appreciate any suggestions

<javascript>
            var myDialog = new YAHOO.widget.SimpleDialog("prompt", {
                close: true,
                width: "50em",
                effect:{
                    effect: YAHOO.widget.ContainerEffect.FADE,
                    duration: 0.25
                },
                fixedcenter: true,
                modal: true,
                visible: false,
                draggable: true
            });
            
         myDialog.setHeader("Warning!");
           
           
          
           
         myDialog.setBody('<div id="my-tree"></div>');     
        
            var tree = new Alfresco.RepositoryDocListTree("my-tree").setOptions({
                rootNode : 'alfresco:\/\/company\/home',
                evaluateChildFolders : true,
                maximumFolderCount : 10,
                setDropTargets : false
            }).setMessages({"header.library": "MyTree", "node.root": "Documents"});
           
            var select = function() {
            
             console.log("select");
            };
           
            var close = function() {
               
                this.hide();
            };
            var actions = [
                { text: "toggle all", handler: select },
                { text:"close", handler: close}
            ];
           
            myDialog.cfg.queueProperty("buttons", actions);          
            myDialog.render(document.body);           
            myDialog.show();
</javascript>

Outcomes