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:
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:
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); // ... }
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(); } } }, });
Comment