Announcement

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

    ListGrid implicitCriteria + groupBy and records more than groupByMaxRecords data refresh bug (12.0/12.1/13.0p)

    Hi Isomorphic,

    please see this modified sample (v12.1p_2022-08-24, as I want to switch to 12.1p, but also current 12.0p, 13.0p).
    The testcase has more buttons than it needs. I found out only while building it according to my app, that the issue is actually related to groupByMaxRecords and only then to implicitCriteria (normal filterRow is working fine).
    Also, if you remove groupByMaxRecords, everything regarding implicitCriteria-changes is fine.

    Steps to reproduce (Win10/FF 103, Chromium 103):
    • Start (starts with criteria for all continents, 216 rows, more than the configured 175 for groupByMaxRecords)
    • Click "inSet: AS..." (without Africa)
    • Note that the ListGrid does not load new data (unexpected)
    • Hover the ListGrid body
    • Turn the mouse wheel down
    • Note that the ListGrid does only now load new data with the new implicitCriteria
    • Repeat with different implicitCriteria
    Best regards
    Blama

    Code:
    isc.ListGrid.create({
        ID: "filterGrid",
        width: 850,
        height: 500,
        alternateRecordStyles: true,
        dataSource: worldDS,
        autoFetchData: true,
        groupByField: "continent",
        groupStartOpen: "all",
        sortField: "continent",
        groupByMaxRecords: 80,
        sortByGroupFirst: "true",
        implicitCriteria: {
            _constructor: "AdvancedCriteria",
            operator: "and",
            criteria: [{
                fieldName: "continent",
                operator: "inSet",
                value: ["Africa", "Asia", "Australia/Oceania", "Europe", "North America", "South America"]
            }]
        },
        fields: [{
            name: "countryCode",
            width: 60
        }, {
            name: "government",
        }, {
            name: "continent",
        }, {
            name: "capital",
        }, {
            name: "independence",
            width: 100
        }, {
            name: "population",
            width: 100
        }, {
            name: "gdp",
            width: 85
        }]
    });
    
    // Implicit criteria Buttons
    isc.IButton.create({
        ID: "europeAsiaBtn",
        width: 250,
    
        title: "inSet: AF/AS/AU/EU/NA/SA (=all)",
        click: function() {
            filterGrid.setImplicitCriteria({
                _constructor: "AdvancedCriteria",
                operator: "and",
                criteria: [{
                    fieldName: "continent",
                    operator: "inSet",
                    value: ["Africa", "Asia", "Australia/Oceania", "Europe", "North America", "South America"]
                }]
            });
        }
    });
    isc.IButton.create({
        ID: "europeAsiaAusBtn",
        width: 250,
    
        title: "inSet: AS/AU/EU/NA/SA",
        click: function() {
            filterGrid.setImplicitCriteria({
                _constructor: "AdvancedCriteria",
                operator: "and",
                criteria: [{
                    fieldName: "continent",
                    operator: "inSet",
                    value: ["Asia", "Australia/Oceania", "Europe", "North America", "South America"]
                }]
            });
        }
    });
    isc.IButton.create({
        ID: "allCtnBtn",
        width: 250,
    
        title: "All continents (null criteria)",
        click: function() {
            filterGrid.setImplicitCriteria(null);
        }
    });
    isc.HStack.create({
        ID: "criteriaBtnStack",
        membersMargin: 30,
        height: 1,
        members: [
            isc.Label.create({
                contents: "Implicit Criteria:",
                height: 1
            }), europeAsiaBtn, europeAsiaAusBtn, allCtnBtn
        ]
    });
    
    
    // Filter criteria Buttons
    isc.IButton.create({
        ID: "showFilterRowBtn",
        width: 250,
        title: "Show filterRow",
        click: function() {
            filterGrid.setShowFilterEditor(true);
        }
    });
    isc.IButton.create({
        ID: "hideFilterRowBtn",
        width: 250,
        title: "Reset fR + hide: setFEdCrit(null) + fetchData()",
        click: function() {
            filterGrid.setFilterEditorCriteria(null);
            filterGrid.setShowFilterEditor(false);
            filterGrid.fetchData();
        }
    });
    isc.IButton.create({
        ID: "resetFilterRowBtn",
        width: 250,
        title: "Reset fR: setFEdCrit(null) + fetchData()",
        click: function() {
            filterGrid.setFilterEditorCriteria(null);
            filterGrid.fetchData();
        }
    });
    isc.IButton.create({
        ID: "resetFilterBtn",
        width: 250,
        title: "Reset fR: filterData(null)",
        click: function() {
            filterGrid.filterData(null);
        }
    });
    isc.HStack.create({
        ID: "filterBtnStack",
        height: 1,
        membersMargin: 30,
        members: [
            isc.Label.create({
                contents: "Filter:",
                height: 1
            }),
            showFilterRowBtn, hideFilterRowBtn, resetFilterRowBtn, resetFilterBtn
        ]
    });
    
    isc.VStack.create({
        membersMargin: 30,
        members: [
            criteriaBtnStack, filterBtnStack, filterGrid
        ]
    });

    #2
    Hi Isomorphic,

    could you reproduce the problem or do you need more details?

    Thank you & Best regards
    Blama

    Comment


      #3
      Apologies for the delay in getting back to you - yes, it's been assigned and we'll update here shortly when we have more information.

      Comment


        #4
        hi Blama ,

        Sorry for the delay on this one - it's been addressed for tomorrow's builds of affected branches

        You can likely work around it in the meantime, by calling markForRedraw() on your grid after setImplicitCriteria().

        Comment


          #5
          Hi Isomorphic,

          there are no new builds for today as of now, but I can see that the sample code from #1 + filterGrid.markForRedraw() works in v12.1p_2022-09-09. Thank you very much.
          I'll also test that in my application.
          If markForRedraw() works there as well, I might stay with my version (v12.1p_2022-08-10), as quite some time of manual testing went in there already.

          Thank you & Best regards
          Blama

          Comment


            #6
            Hi Isomorphic,

            it seems to work as expected with v12.1p_2022-08-10 + filterGrid.markForRedraw() in my application.

            Thanks a lot,
            Blama

            Comment


              #7
              You should still take tomorrow's build of 12.1 to pick up the fix (which has been refined today).

              The problem was actually that, in a grid with a groupByMaxRecords value, the initial fetch for data sets an internal flag to temporarily prevent dataChanged() from issuing a redraw - but the flag wasn't being cleared, in this case, so dataChanged() was never redrawing the grid after that point, unless a regroup had been performed.
              Last edited by Isomorphic; 13 Sep 2022, 04:52.

              Comment

              Working...
              X