Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    How to show a tree item picker at startup?

    Hi,

    I am trying to have a SelectItem's picker opened at the startup of my application. I tried to simulate the "click" event, or to call "showPicker", but neither of them works. Is there any built-in way or any hack to achieve this?

    To clarify: It is not important, that the whole tree is unfolded, I just want to see the first level of elements.

    My SmartClient version is v11.1p_2018-02-11/LGPL Deployment (built 2018-02-11).
    I'm testing with Chrome 64.0.3282.140 (64-Bit)

    Code:
    isc.DynamicForm.create({
        fields: [
            isc.SelectItem.create({
                ID: "sel",
                type: "pickTree",
                title: "cat",
                valueTree: isc.Tree.create({
                    modelType: "children",
                    root: {
                        name: "root", children: [
                            {name: "a"},
                            {
                                name: "b", children: [
                                    {name: "b1"},
                                    {name: "b2"}
                                ]
                            }
                        ]
                    }
                })
            })
        ]
    });
    
    sel.showPicker();
    Thanks a lot in advance!
    Slartidan

    #2
    Your code is broken - never create() a FormItem directly. If you look in your Developer Console, it's telling you this.

    Auto-opening a pickTree doesn't seem like a good idea, as it would appear broken, as users don't expect menus to just pop open. If you really want some kind of initial tree visible, it's probably best to use a TreeGrid, and have it disappear after the user has interacted with it.

    Comment

    Working...
    X