Announcement

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

    10.1p/11.1p/12.0d: Bug / Enhancement when grouped ListGrid totalRows falls below groupByMaxRecords after filtering

    Hi Isomorphic,

    please see this modified sample in any (10.1p/11.1p/12.0d) of the SmartClient Online Showcases (all mid December 2017).
    Code:
    isc.ListGrid.create({
        ID:"dsListGrid", 
        width: "100%",
        height: 300,
        minFieldWidth:80,
        autoFetchData: true,
        dataSource: "supplyItem",
        groupByField: 'units',
        showFilterEditor: true
    });
    
    isc.ListGrid.create({
        ID:"dsListGrid2",
        width: "100%",
        height: 300,
        top: 310,
        minFieldWidth:80,
        autoFetchData: true,
        dataSource: "supplyItem",
        groupByField: 'units',
        showFilterEditor: true,
        initialCriteria: { _constructor: "AdvancedCriteria", operator: "and",
            criteria: [
                { fieldName: "unitCost", operator: "equals", value: 0.41 }
            ]
        }
    });
    After running, filter the top ListGrid for unitCost: 0.41 as well.
    As you can see, the ListGrid is not grouped by.
    I understand that it was not grouped by at start because there where too many records. But after filtering, when totalRows is below groupByMaxRecords, I'd expect the grid to be filtered, because that's what I configured.
    In my application, the user can't group the ListGrid (canGroupBy: false), so a manual regroup by the user is not possible.

    Best regards
    Blama

    #2
    This is not the intended behavior of setting groupByField at init. You seem to think of it as a persistent command to perform grouping whenever possible, instead, it is equivalent to a single call to groupBy(), which is just ignored if there are too many records.

    Feel free to detect that filtering has eliminated enough records that grouping is now possible, and then call groupBy() at that time.

    Comment

    Working...
    X