Announcement

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

    Custom listgrid record components not all rendering when hide/show column

    version: v100p_2015-07-04_Pro
    browser: Chrome 43.0.2357.124

    I added a custom function to a TreeGrid via createRecordComponent param. It draws a chart in that column's cells for some rows. Because it uses getChartCenter() and other things that are only accessible during chartDrawn(), I had to set showAllRecords = true on the TreeGrid, so that they would all draw right away (not a lot of rows but not all visible).

    However, when you hide then re-show that column, it only renders rows in the visible region, ignoring the showAllRecords parameter.

    In ISC_Grids.js, in the updateRecordComponents function (which gets called when you show the column again), it iterates over only rows in the drawArea:

    Code:
    for (var rowNum = drawArea[0]; rowNum <= drawArea[1]; rowNum++) {
        // ...
        liveComp = this._applyNewRecordComponent(record, fieldName, this.body, rowNum, bodyCol);
        // ...
    }
    Doing a redraw doesn't work, but doing an invalidateRecordComponents() does. Therefore, my workaround right now looks like this hook in my TreeGrid, which keeps track of the state of the field in question with a global variable, and when the state changes, I call the invalidate function that re-renders all the cells that have the custom FacetChart:

    Code:
    // this field is visible initially
    var customFieldIsVisible = true; 
    
    isc.TreeGrid.create({
        ID: "IDTreeGrid1",
        // ....
        fieldStateChanged : function () {
        	if (vSummaryChartVisible 
                    != IDTreeGrid1.fieldIsVisible(fieldCustomChart)) {
                // toggle the external visibility tracker
                customFieldIsVisible = !customFieldIsVisible; 
                // will only fire when column is being UN-hidden
        	    if (customFieldIsVisible) { 
                    this.invalidateRecordComponents();
                }
            }
        },
    });

    #2
    ListGrid.body.getDrawArea() would be expected to return all rows if showAllRecords is set.

    Can you show a simple test-case that shows the effect you're seeing? Its important to know what other grid settings you have - data-binding mechanism, recordComponent methods and pooling mode, for example.
    Last edited by Isomorphic; 7 Jul 2015, 02:49.

    Comment

    Working...
    X