Announcement

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

    Trouble with ListGrid.getDefaultFormattedValue() for boolean column

    Hi,
    I am trying apply ListGrid cell formatter to be able to custom format user formula columns and leave all other columns intact: https://forums.smartclient.com/forum...-locale-format

    I am having problem with column type of boolean and column with displayField set.
    Below is showcase example https://www.smartclient.com/smartcli...d=formatValues
    with two additional columns added:
    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:"independence", title:"Nationhood", type:"date", width: "25%",
                formatCellValue: function (value) {
                    if (isc.isA.Date(value)) {
                        return (new Date().getYear() - value.getYear()) + " years ago";
                    }
                }
            },
            {name:"area", title:"Area", type:"number",
                formatCellValue: "isc.NumberUtil.format(value, ',0') + ' km²'"
            },
            {name:"member_g8", title:"G8", type:"boolean"
    //            ,formatCellValue: "return grid.getDefaultFormattedValue (record, rowNum, colNum)"
            },
            {name:"government", title:"Description", displayField:"article"
    //            ,formatCellValue: "return grid.getDefaultFormattedValue (record, rowNum, colNum)"
            }
        ]
    })
    With formatCellValue commented out I have got the following view of G8 and Description:
    Click image for larger version

Name:	getDefaultFormattedValue0.png
Views:	79
Size:	28.4 KB
ID:	250814

    But with formatCellValue (using return grid.getDefaultFormattedValue()) applied to those columns I got the following:
    Click image for larger version

Name:	getDefaultFormattedValue1.png
Views:	47
Size:	25.0 KB
ID:	250815
    which is wrong - I am expecting the same format as with formatCellValue not used.
    As far as I tested it is working fine applied to other types: date or decimal.
    Thanks,
    MichalG

    #2
    Hi,
    Any news on this subject?
    Thanks,
    MichalG

    Comment

    Working...
    X