Announcement

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

    FilterBuilder.filterChanged triggered multiple times when setting criteria

    Hello, I just noticed that if I call FilterBuilder.setCriteria, the filterChanged handler is called multiple times, I wonder if it's by design, or if it's a bug.

    Test case (same behaviour with latest 13.1, 13.0, 12.1):

    Code:
    isc.ListGrid.create({
        ID: "countryList",
        width: 700, height: 224,
        dataSource: worldDS,
        fields: [
            {name: "countryName"},
            {name: "continent"},
            {name: "population"},
            {name: "area"},
            {name: "gdp"},
            {name: "independence", width: 100}
        ]
    })
    isc.FilterBuilder.create({
        ID: "advancedFilter",
        dataSource: "worldDS",
        filterChanged: function () {
            isc.logEcho('filterChanged')
            countryList.filterData(this.getCriteria());
        }
    });
    isc.IButton.create({
        ID: "filterButton",
        title: "Filter",
        click: function () {
            advancedFilter.setCriteria(
                {
                    _constructor: "AdvancedCriteria",
                    operator: "and", criteria: [
                        {fieldName: "continent", operator: "equals", value: "Europe"},
                        {
                            operator: "or", criteria: [
                                {fieldName: "countryName", operator: "iEndsWith", value: "land"},
                                {fieldName: "population", operator: "lessThan", value: 3000000}
                            ]
                        }
                    ]
                })
        }
    })
    
    isc.VStack.create({
        membersMargin: 10,
        members: [advancedFilter, filterButton, countryList]
    })
    with this criteria, I see 4 calls (and fetches).

    #2
    Hello, any news on this issue?

    Comment


      #3
      This issue has been solved, and the fix will be available in tomorrow's builds, June 20.

      Best Regards
      Isomorphic Software

      Comment


        #4
        SmartClient Version: SNAPSHOT_v13.1d_2024-06-21/AllModules Development Only (built 2024-06-21)

        I can confirm it's fixed, thank you very much

        Comment

        Working...
        X