mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
Adding removeColumns() and removeRows() to GridLayout
This commit is contained in:
committed by
Vladimir Enchev
parent
e79fd51ce4
commit
7d948265f3
@@ -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) {
|
||||
//
|
||||
}
|
||||
|
||||
10
ui/layouts/grid-layout/grid-layout.d.ts
vendored
10
ui/layouts/grid-layout/grid-layout.d.ts
vendored
@@ -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.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user