Announcement

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

    ListGrid editFields() function has problem when field name is "length"

    Hi,

    If you create field with name "length", then it is not possible to show/hide such a column in ListGrid using editFields() field picker. It is perfectly possible to show/hide such a column using grid's context menu at the same time.

    To reproduce you may use showcase https://www.smartclient.com/smartcli...id=columnOrder and change example to:

    Code:
    isc.ListGrid.create({
        ID: "countryList",
        width:500, height:224, alternateRecordStyles:true,
        data: countryData,
        fields:[
            {name:"countryCode", title:"Flag", width:50, type:"image", imageURLPrefix:"flags/16/", imageURLSuffix:".png"},
            {name:"countryName", title:"Country"},
            {name:"capital", title:"Capital", showIf:"false"},
            {name:"continent", title:"Continent"},
            {name:"length", title:"Length"}
        ],
        canReorderFields: true
    })
    
    
    isc.IButton.create({
        left:0, top:240,
        title:"Show Capitals",
        click:"countryList.showField('capital')"
    })
    
    isc.IButton.create({
        left:130, top:240,
        title:"Hide Capitals",
        click:"countryList.hideField('capital')"
    })
    
    countryList.delayCall("editFields");
    and try to hide "Length" column using "Fields Picker" - nothing happens and the following error shows dev console:

    Code:
    13:35:03.486:MUP4:WARN:Log:RangeError: invalid array length
    Stack from error.stack:
        DataSource._trackClientOnlyChanges()
        DataSource.getClientOnlyResponse()
        transformRequest()
        DataSource.sendDSRequest()
        DataSource.performDSOperation()
        Canvas._performDSOperation()
        Canvas.addData()
        Canvas._addIfNotDuplicate()
        Canvas.transferRecords()
        Class.invokeSuper()
        Class.Super()
        FieldPickerListGrid.transferRecords()
        Canvas.transferSelectedData()
        click()
        StatefulCanvas.handleActivate()
        StatefulCanvas.handleClick()
        [c]EventHandler.bubbleEvent()
        [c]EventHandler.handleClick()
        EventHandler._handleMouseUp()
        [c]EventHandler.handleMouseUp()
        [c]EventHandler.dispatch()
        anonymous()
    Thanks,
    MichalG


    #2
    This will be fixed in the nightly builds dated 2020-12-18 back to SC 6.1p/SGWT 11.1p.

    Comment


      #3
      Tested as fixed in SmartClient Version: SNAPSHOT_v13.0d_2021-02-10/LGPL Development Only (built 2021-02-10).
      Thank you.
      MichalG

      Comment

      Working...
      X