TreeList widget is not visible

I studied the contents of the link, but the treelist is not visible.
TreeList Widget : Node-RED
node-red/60-link.html at master · node-red/node-red · GitHub

Below is my code.

<script type="text/html" data-template-name="api-gui">
    <div class="form-row node-input-link-row"></div>
</script>

...

 oneditprepare: function() {        
            let treeList;
            
            treeList = $("<div>")
            .css({width: "100%", height: "100%"})
            .appendTo(".node-input-link-row")
            .treeList({});
         
            treeList.treeList('data',[{label:"Colours", id:'my-red-item'}]);
            setTimeout(function() {
                treeList.treeList('show', 'my-red-item');
            }, 100);
        }
...

I ran it even without setTimeout, but I don't see it.
Did I write something wrong?

Please, give me a solution.

Please don't double post. There was no need to open this 2nd post.

People will answer if they know how to help.

1 Like

Your code looks fine. However, you need to resize the form-row.

You could add a height style ...

<div class="form-row node-input-link-row" style="height: calc(100% - 40px);">

OR

Do what the link node does (as I linked to in your other thread)

See this: 60-link.html#L156-L165
and this: 60-link.html#L267

1 Like

Thanks for your reply.
I solved the problem thanks to you!
And I'll make sure not to double-post.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.