Announcement

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

    null value in summary data formatted as 0?

    Hi, we are seeing a problem where a null value in a summary function is being treated like 0.


    See the price column in this example and use the sample code below. We want the summary data for Price to show as blank and this was working in 8.3 so something changed with 9.0.

    http://www.smartclient.com/#summaryGrid

    Code:
    
    
    isc.ListGrid.create({
        ID: "companyList",
        width:600, height:520,
        alternateRecordStyles:true,
        autoFetchData:true,
        dataSource:orderItemLocalDS,
        showAllRecords:true,
        groupByField:"category", groupStartOpen:"all",
        canEdit:true, editEvent:"click",
        
        showGridSummary:true,
        showGroupSummary:true,
        fields:[
            {name:"orderID", includeInRecordSummary:false, summaryFunction:"count"},
            {name:"itemDescription"},
            {name:"category", showGridSummary:true, 
                getGridSummary:function (records, summaryField) {
                    var seenCategories = {};
                    for (var i = 0; i < records.length; i++) {
                        seenCategories[records[i].category] = true;
                    }
                    var totalCategories = isc.getKeys(seenCategories).length;
                    return totalCategories + " Categories";
                    
                }
            },
            {name:"shipDate", showGroupSummary:true, showGridSummary:false, summaryFunction:"max"},
            
            {name:"quantity", showGroupSummary:false, showGridSummary:false},
            {name:"unitPrice", showGroupSummary:true, showGridSummary:true,summaryFunction:'return null;',
             formatCellValue:function (value) {
    
                
                 if (value!=null && isc.isA.Number(value)) {
                    return value.toCurrencyString("$");
                 }
                 return value;
             }
            },
            {name:"Total", type:"summary", recordSummaryFunction:"multiplier",
             summaryFunction:"sum",
             showGridSummary:true, showGroupSummary:true,
             align:"right",
             formatCellValue:function (value) {
                 if (isc.isA.Number(value)) {
                    return value.toCurrencyString("$");
                 }
                 return value;
             }
            }
        ]
    })

    #2
    This is assigned to a developer for investigation. We should have more information for you next week

    Regards
    Isomorphic Software

    Comment


      #3
      Hi there, any update on this?

      Comment


        #4
        Apologies, we'll take a look just now...

        Comment


          #5
          We've made a change to address this - please retest with a build dated September 19 or later

          Comment


            #6
            Looks good, thanks

            Comment

            Working...
            X