Announcement

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

    initialSort in PickList doesn't seem to work

    I don't get the initialSort working for ComboBoxItem. I've changed the example to include this:

    Code:
    isc.DynamicForm.create({
        ID:"exampleForm",
        width:300,
        fields: [
            {
                name:"itemID",
                type:"select",
                width:240,
                title:"Item",
                optionDataSource:"supplyItem",
                valueField:"SKU",
                displayField:"itemName",
                initialSort: [
                    { property: "unitCosts", direction: "descending" },
                    { property: "itemName", direction: "ascending" }
                ],
                pickListWidth:450,
                pickListFields: [
                    { name: "itemName" },
                    { name: "units" },
                    { name: "unitCost" }
                ],
                pickListProperties: {
                    initialSort: [
                        { property: "unitCosts", direction: "descending" },
                        { property: "itemName", direction: "ascending" }
                    ]
                }
            }
        ]
    });
    I've put initialSort in two places, because to me it is unclear where to put it. But both at once don't seem to work and one directly on the combo box or one in the picklist properties also seems to fail.

    Am I doing something wrong?

    #2
    The field is called "unitCost", not "unitCosts" - correcting that fixes this sample code.

    Comment


      #3
      I'm so sorry... and you are right. I'll didn't manage to make it work in my own code, but I'll try again. It seems to be working if the property is set on the ComboBoxItem itself (and not as child of pickListProperties).

      Comment


        #4
        initialSort is documented on ComboBoxItem, so that is the correct place. Whenever a property is documented on a main component, don't try to set it directly on the autoChild. That's just going to be clobbered by the property on the main component, or by whatever it provides its autoChild as a default.

        Comment


          #5
          Somehow it works. My apologies, I must have done something wrong.

          Comment

          Working...
          X