MCPcopy Index your code
hub / github.com/angular/components / _renderUpdatedColumns

Method _renderUpdatedColumns

src/cdk/table/table.ts:1169–1195  ·  view source on GitHub ↗

* Check if the header, data, or footer rows have changed what columns they want to display or * whether the sticky states have changed for the header or footer. If there is a diff, then * re-render that section.

()

Source from the content-addressed store, hash-verified

1167 * re-render that section.
1168 */
1169 private _renderUpdatedColumns(): boolean {
1170 const columnsDiffReducer = (acc: boolean, def: BaseRowDef) => {
1171 // The differ should be run for every column, even if `acc` is already
1172 // true (see #29922)
1173 const diff = !!def.getColumnsDiff();
1174 return acc || diff;
1175 };
1176
1177 // Force re-render data rows if the list of column definitions have changed.
1178 const dataColumnsChanged = this._rowDefs.reduce(columnsDiffReducer, false);
1179 if (dataColumnsChanged) {
1180 this._forceRenderDataRows();
1181 }
1182
1183 // Force re-render header/footer rows if the list of column definitions have changed.
1184 const headerColumnsChanged = this._headerRowDefs.reduce(columnsDiffReducer, false);
1185 if (headerColumnsChanged) {
1186 this._forceRenderHeaderRows();
1187 }
1188
1189 const footerColumnsChanged = this._footerRowDefs.reduce(columnsDiffReducer, false);
1190 if (footerColumnsChanged) {
1191 this._forceRenderFooterRows();
1192 }
1193
1194 return dataColumnsChanged || headerColumnsChanged || footerColumnsChanged;
1195 }
1196
1197 /**
1198 * Switch to the provided data source by resetting the data and unsubscribing from the current

Callers 1

_renderMethod · 0.95

Calls 3

_forceRenderDataRowsMethod · 0.95

Tested by

no test coverage detected