Announcement

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

    Can the "gray" column in PickTreeItem be hidden? And is multi-select possible?

    Is it possible to hide/remove the "gray" column in a PickTreeItem?

    Click image for larger version

Name:	Screenshot 2020-05-19 at 21.52.17.png
Views:	198
Size:	24.9 KB
ID:	262507
    And another question: is it somehow possible to make it multiple selectable?

    #2
    That grey area is the icon column standard for Menus. You can get rid of it via the AutoChild system: PickTreeItem has an AutoChild button which is a TreeMenuButton, which has an AutoChild treeMenu which is a Menu instance - set fields on that.

    Menus can support a multi-select interface - we do this within the framework for selecting visible fields in the ListGrid header drop-down by showing an additional menu column with checkmarks. But that would take some fairly deep customization of AutoChildren, and might best be done by starting with your own CanvasItem so you are in charge of all of the construction of the TreeMenuButton and Menu.

    A much simpler and immediate way to get a multi-select tree is just to use a SelectItem in tree mode - add multiple:true to that sample and you've got a multi-select tree that is arguably better than hierarchical menus.

    Comment


      #3
      Indeed, the solution was to add these field properties:

      Code:
      {
        buttonProperties: {
          treeMenuProperties: {
            showIcons: false
          }
        },
        editorType: 'PickTreeItem'
      }

      Comment


        #4
        Originally posted by Isomorphic View Post
        A much simpler and immediate way to get a multi-select tree is just to use a SelectItem in tree mode - add multiple:true to that sample and you've got a multi-select tree that is arguably better than hierarchical menus.
        I don't know how to populate the select item. I have unbound data that I need to set based on the value of another field. I've tried to use setValueMap() but can this be used for tree data? And if so, what is the format?

        I would like to show a tree with options like these (each nested property needs to be selectable):

        Code:
        Brand
          X
          Y
          Z
        Color
          Red
          Green
          Blue
        The underlying values would be "brand/x", "brand/y", "brand/z", "color/red", "color/green" and "color/blue" that will be send to the server.

        Comment


          #5
          ? we gave a direct link to the sample.

          Use optionDataSource. No, there is no tree format for valueMap.

          Comment


            #6
            The example provided, uses remote data. I know I can create a data source with local (client-only) data, but in my case I need to change that data dynamically, based on the value of other form fields. Can I create a SelectItem with option multiple set to true, having a client-only data source with initially no data and set that data later?

            Comment


              #7
              The optionDataSource can be a clientOnly DataSource, yes.

              Comment

              Working...
              X