Files
DefinitelyTyped/types/knockout.kogrid/knockout.kogrid-tests.ts
2017-03-24 14:27:52 -07:00

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
};
}
}