Announcement

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

  • 6.1p Strange effect when using autoFitWidthApproach and filerEditorProperties width=*

    Hi,
    This is http://www.smartclient.com/smartclie...adaptiveFilter showcase slightly modified:
    added
    autoFitFieldWidths:true,
    autoFitWidthApproach:"both",
    and
    fields:[
    ...
    {name:"itemName", filterEditorProperties:{width:"*"}},
    Code:
    isc.ListGrid.create({
        ID: "supplyList",
        width:500, height:300, alternateRecordStyles:true,
        wrapHeaderTitles:true,
        autoFitFieldWidths:true,
        autoFitWidthApproach:"both",
        dataSource: supplyItem,
        fields:[
            {name:"SKU", title:"SKU asdsad"},
            {name:"itemName", filterEditorProperties:{width:"*"}},
            {name:"description"},
            {name:"category"}
        ],
        autoFetchData: true,
        showFilterEditor: true,
        filterOnKeypress: true,
        fetchDelay: 500
    });
    
    // ---------------------------------------------------------------------------------------
    // The code that follows is just to illustrate when SmartClient has needed to contact the
    // server. It is not part of the example.
    var origBGColor,
        restoreBGColorTimerID;
    supplyItem.addProperties({
    
        transformResponse: function (dsResponse) {
            if (this.dataFormat == "iscServer") this.updateRowCountLabel(dsResponse);
        },
        // This approach logs simulated server trips for SmartClient LGPL, where all DataSources
        // in the Feature Explorer are converted to clientOnly:true so that no server is required.
        getClientOnlyResponse : function (dsRequest) {
            var dsResponse = this.Super("getClientOnlyResponse", arguments);
            this.updateRowCountLabel(dsResponse);
            return dsResponse;
        },
        updateRowCountLabel : function (dsResponse) {
            serverCount.incrementAndUpdate(dsResponse.totalRows,
                                           dsResponse.startRow,
                                           dsResponse.endRow);
            // Flash the label
            if (restoreBGColorTimerID == null) origBGColor = serverCount.backgroundColor;
            else isc.Timer.clear(restoreBGColorTimerID);
            serverCount.setBackgroundColor("#ffff77");
            restoreBGColorTimerID = isc.Timer.setTimeout(function () {
                restoreBGColorTimerID = null;
                serverCount.setBackgroundColor(origBGColor);
            }, 500);
        }
    })
    var serverCount = isc.Label.create({
        top: 320, padding: 10,
        width: 500, height: 40,
        border: "1px solid grey",
        contents: "<b>Number of server trips: 0</b>",
        count: 0,
        incrementAndUpdate: function (totalRows, startRow, endRow) {
            this.count++;
            this.setContents("<b>Number of server trips: " + this.count +
                             "<br/>Total rows in this filter set: " + totalRows +
                             "<br/>Last range of records returned: " +
                             startRow + " to " + endRow + "</b>");
        }
    });
    If you try it online you can see that Item filter editor field is not wide enough to fill the column cell space:
    filterEditorPropertiesWidth.png
    Thanks,
    MichalG

  • #2
    We've resolved this issue in the branches affected - SGWT 6.1p/SC 11.1p and newer - and the fix will be in the next nighly builds released, dated 2017-07-11 and beyond.

    Comment


    • #3
      Hi,
      I would like to test and use this fix, but daily builds seems to be suspended since 2017-07-09 ?
      Regards,
      MichalG

      Comment


      • #4
        Hi,
        Verified in SmartClient Version: v11.1p_2017-07-20/LGPL Development Only (built 2017-07-20).
        Thank you.
        MichalG

        Comment

        Working...
        X