Skip to content

Commit

Permalink
remove toggle from RowType interface, fix FinJsDemo (#10540)
Browse files Browse the repository at this point in the history
* fix(grid): remove toggle from RowType interface
  • Loading branch information
hanastasov authored Nov 18, 2021
1 parent fc338b6 commit da45fe8
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 8 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,11 @@ All notable changes for each version of this project will be documented in this
Use `IgxGridToolbarComponent`, `IgxGridToolbarHidingComponent`, `IgxGridToolbarPinningComponent` instead.
- **Breaking Change** - The `rowSelected` event is renamed to `rowSelectionChanging` to better reflect its function.
- **Breaking Change** - The `columnSelected` event is renamed to `columnSelectionChanging` to better reflect its function.
- **Breaking Change** - `columnsCollection` is removed. Use `columns` instead.
- **Breaking Change** - `columnsCollection` is removed. Use `columns` instead. If at certain ocasions `columns` return empty array, query the columns using `ViewChildren` and access those in `ngAfterViewInit`:
```ts
@ViewChildren(IgxColumnComponent, { read: IgxColumnComponent })
public columns: QueryList<IgxColumnComponent>;
```
- `RowType`, `IgxRowDirective`
- **Breaking Change** - `rowData` and `rowID` deprecated properties are now removed. Use `data` and `key` instead. Use `ng update` for automatic migration.
- `igxRowSelector`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ export interface RowType {
delete?: () => any;
pin?: () => void;
unpin?: () => void;
toggle?: () => void;
}

export interface ColumnType {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ export class IgxExcelStyleMovingComponent {
return columns[index];
}
}
return columns[0];
} else {
while (index < columns.length - 1) {
index++;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -520,13 +520,15 @@ export class IgxGridNavigationService {
}
} else if (!row.expanded && ROW_EXPAND_KEYS.has(key)) {
if (row.key === undefined) {
row.toggle();
// TODO use expanded row.expanded = !row.expanded;
(row as any).toggle();
} else {
this.grid.gridAPI.set_row_expansion_state(row.key, true, event);
}
} else if (row.expanded && ROW_COLLAPSE_KEYS.has(key)) {
if (row.key === undefined) {
row.toggle();
// TODO use expanded row.expanded = !row.expanded;
(row as any).toggle();
} else {
this.grid.gridAPI.set_row_expansion_state(row.key, false, event);
}
Expand Down
6 changes: 2 additions & 4 deletions src/app/shared/financialData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -895,12 +895,10 @@ export class FinancialData {

/** Updates values in random records */
public static updateRandomPrices(data: any[]): any[] {
const newData = data.slice();
// fixing a strange bug where newData has more elements than data, but all of those "explicit" items are undefined
for (let i = Math.round(Math.random() * 10); i < data.length; i += Math.round(Math.random() * 10)) {
newData.push(this.randomizeObjectData(newData[i]));
this.randomizeObjectData(data[i]);
}
return newData;
return Array.from(data);
}

/*** Genrates additional financial data fields */
Expand Down

0 comments on commit da45fe8

Please sign in to comment.