mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-24 05:06:02 +08:00
28 lines
800 B
TypeScript
28 lines
800 B
TypeScript
export interface IGridItem {
|
|
name: string;
|
|
}
|
|
|
|
export class Tests {
|
|
public items: KnockoutObservableArray<IGridItem>;
|
|
public selectedItems: KnockoutObservableArray<IGridItem>;
|
|
public gridOptionsAlarms: kg.GridOptions<IGridItem>;
|
|
|
|
constructor() {
|
|
this.items = ko.observableArray<IGridItem>();
|
|
this.selectedItems = ko.observableArray<IGridItem>();
|
|
this.gridOptionsAlarms = this.createDefaultGridOptions(this.items, this.selectedItems);
|
|
}
|
|
|
|
public createDefaultGridOptions<Type>(dataArray: KnockoutObservableArray<Type>, selectedItems: KnockoutObservableArray<Type>): kg.GridOptions<Type> {
|
|
return {
|
|
data: dataArray,
|
|
displaySelectionCheckbox: false,
|
|
footerVisible: false,
|
|
multiSelect: false,
|
|
showColumnMenu: false,
|
|
plugins: null,
|
|
selectedItems: selectedItems
|
|
};
|
|
}
|
|
}
|