Announcement

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

    PickListProperties: autoFitData='both' only works with showHeader=false

    I'm trying to get a picklist to display data wider than the select box it is linked to . autoFitData="both" will do this but only if showHeader=false.

    Is it possible to get it to work while also showing the header?

    Code:
    viewData = isc.DataSource.create({
            clientOnly: true,
            fields: [ {name: "default", type:"image"}, {name:"current", type: "image" }, {name:"display"} ],
            cacheData: [
                { default: "", current: "", display: "AAA AAA AAA AAA AAA AAA AAA" },
                { default: "[SKIN]/headerIcons/pin_down.png", current: "[SKIN]/Menu/check.png", display: "BBB" },
                { default: "", current: "", display: "CCC" }
            ]
        });
    
        isc.DynamicForm.create({
            fields: [{
                name: "itemName",
                title: "Item Name", 
                type: "select",
                optionDataSource: viewData,
                valueField: "display",
                displayField: "display",
    	    pickListProperties: { autoFitData: "both", showHeader:true },
                pickListFields: [
                  { name: "current", align: "center", width: 25, title: "Current" },
                  { name: "default", align: "center", width: 25, title: "Default" },
                  { name: "display", title: "Name", sortDirection: "ascending" }
                ]
            }]
        });
    TIA,

    Dan

    SmartClient Version: SC_SNAPSHOT-2011-05-27/LGPL Deployment

    #2
    Having the same problem with latest SC. I found cause in ISC_Forms.js isc.PickList.addInterfaceMethods setUpPickList function:

    Code:
            var autoFitWidth = this.autoSizePickList && !this.pickList.showHeader;
            this.pickList.autoFitFieldWidths = autoFitWidth;
            this.pickList.setAutoFitData(autoFitWidth ? "both" : "vertical");
            var minHeight = 1;
    So autofit works only if showHeader is false. I do not see any obvious reasons for such behavior. Is it a bug or it makes some sense?

    Comment

    Working...
    X