Announcement

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

    ComboBoxItem + canResizeFields => Can the picker's width adapt ?

    SmartClient Version: v12.0p_2018-09-15/Pro Deployment (built 2018-09-15)

    Go to https://www.smartclient.com/smartcli...d=dropdownGrid and add the following code after the "
    Code:
    pickListFields
    " property:
    Code:
    ,
    pickListProperties :
    {
        canResizeFields : true
    }
    This will make the fields resizable inside the ComboBoxItem. This is the feature we want.

    BUT, if you make a column wider, a scrollbar will appear at the bottom of the ComboBoxItem.

    Is there a way to avoid this scrollbar and have the ComboBoxItem grow to adapt to the sum of the pickListFields' width ?

    Thanks !

    #2
    It sounds like you are looking for autoFitData:"horizontal". Note that you should probably consider turning on autosizing to data for some of the fields in the picklist. Making the user resize fields is not as good as just getting the field widths right, such that resizing is less likely to be necessary, especially as resizing a pickList is a bit awkward.

    Comment


      #3
      Thanks for the reply.

      I tried
      Code:
      autoFitData:"horizontal"
      on https://www.smartclient.com/smartcli...d=dropdownGrid, but couldn't get it to work (looks like pickListProperties is not the right place to set it).

      Can you please post here a way to get it in action on your showcase ?

      Thanks !

      Comment


        #4
        Hello Isomorphic,

        I wanted to make sure you saw my last question from last Friday; I'm waiting for an answer to complete my work.

        Comment


          #5
          Try autoFitFieldWidths:true on the pickListProperties.

          Comment


            #6
            What you wrote doesn't work.

            I started with https://www.smartclient.com/smartcli...d=dropdownGrid and changed the code with:
            Code:
            isc.DynamicForm.create({
                ID:"exampleForm",
                width:300,
                fields: [
                    {
                        name:"itemID",
                        type:"select",
                        width:240,
                        title:"Item",
                        optionDataSource:"supplyItem",
                        valueField:"SKU",
                        displayField:"itemName",
                        pickListWidth:450,
                        pickListFields: [
                            { name: "itemName" },
                            { name: "units" },
                            { name: "unitCost" }
                        ],
            pickListProperties :
            {
                canResizeFields : true,
                autoFitData : "horizontal",
                autoFitFieldWidths : true
            }
                    }
                ]
            });
            I asked you for a working example; please provide one because what you're suggesting is incomplete.

            Comment


              #7
              My intent was to show how to fit the field widths so there was less need to resize them as previously suggested. For this sample I would also add: autoFitWidthApproach: "both".

              If you want the picklist width to grow wider you will need to adjust the pickListMaxWidth value which defaults to 400. If you don't care about the max width just set it to null.

              Comment

              Working...
              X