Announcement

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

    groupByAsyncThreshold

    Hello,

    We are working on migrating to Smartclient 9.0 and have discovered that this new property groupByAsyncThreshold is giving us problems with our grouped grids. It looks like this is perhaps a property that is only really necessary with IE8 or below? We aggressively push our users towards Google Chrome and restrict IE 8 and earlier completely from our application. So, can we effectively ignore this threshold in our application or set it so high that it has no effect?

    http://www.smartclient.com/docs/9.0/a/b/c/go.html#attr..ListGrid.groupByAsyncThreshold

    #2
    If you raise the groupByAsyncThreshold (or effectively eliminate it by setting it to exceed groupByMaxRecords), you may encounter script-running-slowly warnings with large grids.

    When the warning pops up is dependent upon numerous factors -- in addition to browser version and OS, there's things like number of columns, layers of grouping, custom groupBy functions, etc. The default setting is very aggressive. In our testing we found it was a small enough batch size to avoid the warnings even when grouping large (thousands of records) grids back to Internet Explorer 6.

    As such, we can't guarantee you won't see the warnings if you remove the threshold, but yes - earlier versions of Internet Explorer are far worse than more recent browsers, particularly Google Chrome, so you are very likely to be fine essentially eliminating this threshold in your scenario. Obviously we'd recommend you do some testing to ensure things behave correctly for you.

    Regards
    Isomorphic Software

    Comment


      #3
      Thanks for the further detail. Is there any sort of notification when grouping is complete via this asynchronous process? Our problem is that we have logic that assumed that groupBy was synchronous and so logic that executed immediately after the groupBy call that started failing with 9.0. If there is some notification that tells us when grouping is complete, we could refactor this code to take advantage of this performance enhancement.

      Comment


        #4
        You can handle any grouping changes by overriding methods markForRedraw and redraw of your ListGrid. See the example:
        Code:
        // If you need to know was grouping asynchronous or not you could use this method
        isAsyncGrouping : function () {
            var data = this.getOriginalData();
            var res = isc.isA.ResultSet(data) ? 
                 data.lengthIsKnown() && data.rangeIsLoaded(0, data.getLength()) && data.getLength() > this.groupByAsyncThreshold :
                 data.getLength() > this.groupByAsynchThreshold;
            return res;
        },
        redraw : function () {
            this.Super("redraw", arguments);
            // if you need to do smth after grid was updated due to changed grouping or data loaded at first time you could do it there
            // To be sure that redraw caused by regrouping check the reason in markForRedraw method  and store it
            if (this.redrawReason == "regroup") {
                isc.logWarn("redraw after regroup: isAsync " + this.isAsyncGrouping());            
            }
            delete this.redrawReason;
        },
        markForRedraw : function (reason) {
            this.Super("markForRedraw", arguments);
            // remember the reason to be sure that redraw caused by regrouping
            this.redrawReason = reason;
            isc.logWarn("markForRedraw " + reason + " " + this.isAsyncGrouping());
        }

        Comment

        Working...
        X