Announcement

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

    12.0p implicitCriteria + filterRow criteria conversion bug

    Hi Isomorphic,

    I think there is a problem with filterRow-SelectItem criteria. Depending on whether there is implicitCriteria it produces array-criteria or iContains-criteria.
    I'm testing in 13.0p, because this version has the nice feature of a human readable hover description of the criteria, but it also applies to 12.0p and 12.1p.

    I'd always expect the latter case for the SelectItem-criteria, as it is a selection and should not result in iContains, especially as the hover say this all the time:
    "Field criteria: Government is one of commonwealth".
    1. Start sample
    2. Show filter row
    3. Filter for "commonwealth"
      Code:
      	Request:
      	data:{
      	        operator:"and",
      	        criteria:[
      	            {
      	                fieldName:"continent",
      	                operator:"inSet",
      	                value:[
      	                    "Africa",
      	                    "Asia",
      	                    "Australia/Oceania",
      	                    "Europe",
      	                    "North America",
      	                    "South America"
      	                ]
      	            },
      	            {
      	                fieldName:"government",
      	                operator:"iContains",
      	                value:"commonwealth"
      	            }
      	        ]
      	    },
    4. Click the null-implicitCriteria button
      Code:
      	data:{
      	        government:[
      	            "commonwealth"
      	        ]
      	    },

    Best regards
    Blama

    Please see this modified testcase (v13.0p_2024-06-04):
    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
        ]
    });
Working...
X