Adding removeColumns() and removeRows() to GridLayout

This commit is contained in:
Matt Donovan
2015-06-06 15:53:22 -05:00
committed by Vladimir Enchev
parent e79fd51ce4
commit 7d948265f3
2 changed files with 26 additions and 0 deletions

View File

@@ -202,6 +202,22 @@ export class GridLayout extends layouts.LayoutBase implements definition.GridLay
this.onColumnRemoved(itemSpec, index);
}
public removeColumns() {
for (var i = 0; i < this._cols.length; i++) {
this._cols[i].index = -1;
}
this._cols.length = 0;
this.invalidate();
}
public removeRows() {
for (var i = 0; i < this._rows.length; i++) {
this._rows[i].index = -1;
}
this._rows.length = 0;
this.invalidate();
}
protected onRowChanged(element: view.View, oldValue: number, newValue: number) {
//
}

View File

@@ -131,11 +131,21 @@
*/
public removeColumn(itemSpec: ItemSpec): void;
/**
* Removes all columns specification from a GridLayout.
*/
removeColumns(): void;
/**
* Removes a row specification from a GridLayout.
*/
public removeRow(itemSpec: ItemSpec): void;
/**
* Removes all rows specification from a GridLayout.
*/
removeRows(): void;
/**
* Gets array of column specifications defined on this instance of GridLayout.
*/