Announcement

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

    ListGrid formatCellValue - loses standard formatting.

    If I override the formatCellValue function on a ListGrid, how do I call the standard formatting routines?

    I seem to lose the ability to format images for instance - short of rewriting my own image formatter.

    e.g.

    Code:
        data = isc.DataSource.create({
            clientOnly: true,
            fields: [ 
                {name: "icon", type:"image"}, 
                {name:"description" }
            ],
            cacheData: [
                { icon: "[SKIN]/headerIcons/close.png", description: "Item 1" },
                { icon: "[SKIN]/headerIcons/close.png", description: "Item 2" }
            ]
        });
    
        isc.ListGrid.create({
            width: "100%",
            height: "100%",
            dataSource: data,
            autoFetchData: true
        });
    Works fine. If I put a formatCellValue handler in;


    Code:
        data = isc.DataSource.create({
            clientOnly: true,
            fields: [ 
                {name: "icon", type:"image"}, 
                {name:"description" }
            ],
            cacheData: [
                { icon: "[SKIN]/headerIcons/close.png", description: "Item 1" },
                { icon: "[SKIN]/headerIcons/close.png", description: "Item 2" }
            ]
        });
    
        isc.ListGrid.create({
            width: "100%",
            height: "100%",
            dataSource: data,
            autoFetchData: true,
            formatCellValue: function (value, record, rowNum, colNum) {
                return value;
            }
        });
    Then my images no longer render. If I use;

    Code:
    return this.Super("formatCellValue", arguments);
    then nothing renders.

    Looking at ListGrid.js I can see that I seem to have to call the _typeFormatter of the field if it exists, but how do I call this internal function and is that the correct thing to do?

    #2
    Anyone with any clues on this one? I don't want to have to workaround this if it turns out I've missed something obvious.

    Comment


      #3
      OK, well I suppose the message is do not use formatCellValue.

      Comment


        #4
        Have had to change it to use the deprecated getCellValue where the call;

        this.Super("getCellValue", arguments);

        does return the default formatted value, unlike;

        this.Super("formatCellValue", arguments);

        which does not.

        Comment

        Working...
        X