Announcement

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

    sortByGroupFirst issue

    We are seeing some issues with ListGrid.sortByGroupFirst functionality. I'll start with the first problem we can recreate and then may need to provide some other examples after that.


    See this example:
    http://www.smartclient.com/docs/10.0/a/system/reference/SmartClient_Explorer.html#dataTypes


    Use this Code below and try to sort the Area column by clicking on the column header. It sorts one time and then no longer sorts when you click the column header. If you remove the sortByGroupFirst option and try again, it seems to work. So, using sortByGroupFirst is causing some problem here.

    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"},
            {name:"government"},
            {name:"area", title:"Area (km²)", type:"float", format:",0"},
            {name:"gdp_percap", title:"GDP (per capita)", align:"right",
                formatCellValue: function (value, record) {
                    var gdpPerCapita = Math.round(record.gdp*1000000000/record.population);
                    return isc.NumberUtil.format(gdpPerCapita, "\u00A4,0.00");
                }
            }
        ],
         groupStartOpen:"all",
        sortByGroupFirst:true,
    
       groupByField:"government"
    })

    #2
    We're taking a look and will update here when we have more information

    Comment


      #3
      This looks to be the result of a non-databound grid with a groupField with no specified "type".

      If you just add type: "text"to the group field definition, does it start working properly?

      Comment


        #4
        Yes, adding type:"text" to government fixes the problem. Thanks. I'll continue to review the problem we are seeing and let you know if I can find another reason for the sorting problem we are seeing.

        Comment


          #5
          We've fixed the bug where a groupField with no specified type would produce the wrong sort order.

          We've also fixed a couple of other obscure bugs around combined grouping and sorting, so if you think you're seeing odd behaviors in this area, it's probably worth updating to a build dated November 26 - we may have already addressed the causes.

          Comment

          Working...
          X