Announcement

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

    ListGrid Grouping versus Row Count

    Hi,

    How can I get the row count for a listGrid which has grouping turned on for some of its columns ?

    It seems that ListGrid .data.getLength() differs when the grid data is grouped or not ...

    To reproduce, go to http://www.smartclient.com/docs/7.0rc2/a/system/reference/SmartClient_Explorer.html#dynamicGrouping

    Paste the following code:

    Code:
    isc.ListGrid.create({
        ID: "countryList",
        width:522, height:224,
        alternateRecordStyles:true, cellHeight:22,
        dataSource: countryDS,
        // display a subset of fields from the datasource
        fields:[
            {name:"countryName"},
            {name:"government"},
            {name:"continent"},
            {name:"countryCode", title:"Flag", width:40, type:"image", imageURLPrefix:"flags/16/", imageURLSuffix:".png", canEdit:false}
        ],
        cellDoubleClick : function(record, rowNum, colNum)
        {
            isc.logWarn("tree size : " + this.data.getLength());
        },
        groupStartOpen:"all",
        groupByField: 'continent',
        autoFetchData: true
    })
    The double-click event handle doesn't produce consistent row count whether data is grouped or not.

    Thanks for your help,

    #2
    Use listGrid.originalData.getLength()

    http://www.smartclient.com/docs/7.0rc2/a/b/c/go.html#attr..ListGrid.originalData

    Comment


      #3
      Thanks,

      That works!

      Comment

      Working...
      X