Announcement

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

    12.1p+ implicitCriteria data reload only after second click

    Hi Isomorphic,

    please see this modified sample (v12.1p_2024-06-02, but also 13.0p).
    1. Start sample (starts with implicitCriteria from 1st button)
    2. Switching data with the 2nd and 1st button always results in a data reload (expected)
    3. Show the filter row
    4. Filter Government for "commonwealth" in the dropdown, filter for it
    5. Switching data with the 2nd and 1st button always results in a reload when switching 2nd->1st (expected)
    6. Switching data with the 2nd and 1st button requires a 2nd click on the 2nd button when switching 1st->2nd (unexpected)
    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", filterEditorProperties:{type:"SelectItem", sortField:"government", multiple:true},
        }, {
            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: "Hide filterRow",
        click: function() {
            filterGrid.setShowFilterEditor(false);
        }
    });
    
    isc.HStack.create({
        ID: "filterBtnStack",
        height: 1,
        membersMargin: 30,
        members: [
            isc.Label.create({
                contents: "Filter:",
                height: 1
            }),
            showFilterRowBtn, hideFilterRowBtn
        ]
    });
    
    isc.VStack.create({
        membersMargin: 30,
        members: [
            criteriaBtnStack, filterBtnStack, filterGrid
        ]
    });

    #2
    Hi Isomorphic,

    just to let you know, this is still happening using v12.1p_2024-06-21 and SNAPSHOT_v13.1d_2024-06-28.
    Not important for me though.

    Best regards
    Blama

    Comment


      #3
      This should be fixed now in SC 12.1+ for nightly builds dated 2024-07-03 and beyond.

      For #6, you should no longer see a fetch no matter how many times the button is clicked, since the criteria are being narrowed relative to the criteria from #5. For #5, you'll still see a fetch the first time it's clicked as expected (when switching criteria from #6) since the criteria are being widened.

      Comment


        #4
        Hi Isomorphic,

        I can see this is fixed using v12.1p_2024-07-05.
        I noticed another anomaly here, though, with the same sample:
        1. Start sample (starts with implicitCriteria from 1st button)
        2. Show the filter row
        3. Filter Government for "commonwealth" in the dropdown, filter for it
          1. Click null-Implicit criteria -> fetch
          2. Switch data with middle button (AS/AU/EU/NA/SA) and left button (all) -> fetch for every left button click
        4. Filter Government for "commonwealth" in the dropdown, filter for it
          1. Click null-Implicit criteria -> fetch
          2. Switch data with left button (all) and middle button (AS/AU/EU/NA/SA) -> no fetch ever
        I'd somehow assume no fetch here in either case, as the full ResultSet is 4 rows and whatever implicitCriteria you throw at it, it should be able to display from cache.

        It is not important for me, though.

        Best regards
        Blama

        Comment

        Working...
        X