mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-10 09:40:21 +08:00
Merge pull request #2591 from borisyankov/fix-slickgrid
fix SlickGrid declaration
This commit is contained in:
@@ -47,7 +47,7 @@ grid.getDataItem(14).title;
|
||||
|
||||
grid.setData([{ title: "task", duration: "5 days", percentComplete: 5, start: "01/01/2013", finish: "12/12/2013", effortDriven: false }], true);
|
||||
|
||||
var ids = [];
|
||||
var ids: string[] = [];
|
||||
for (i = 0; i < grid.getDataLength(); i++) {
|
||||
ids.push(grid.getDataItem(i).title);
|
||||
}
|
||||
@@ -82,7 +82,7 @@ class SingleCellSelectionModel extends Slick.SelectionModel<MyData, Slick.Range[
|
||||
this.self._grid.onClick.unsubscribe(this.self.handleGridClick);
|
||||
}
|
||||
|
||||
public handleGridClick(e, args) {
|
||||
public handleGridClick(e: any, args: any) {
|
||||
var cell = this.self._grid.getCellFromEvent(e);
|
||||
if (!cell || !this.self._grid.canCellBeSelected(cell.row, cell.cell)) {
|
||||
return;
|
||||
@@ -200,3 +200,13 @@ grid.setCellCssStyles("test", {
|
||||
var dataView = new Slick.Data.DataView<MyData>();
|
||||
var gridWithDataView = new Slick.Grid<MyData>('#grid2', dataView, columns, options);
|
||||
dataView.getIdxById('foo') + 5;
|
||||
|
||||
columns.forEach(column => {
|
||||
if (column.editor !== Slick.Editors.Integer) {
|
||||
return;
|
||||
}
|
||||
});
|
||||
|
||||
grid.onSort.subscribe((e, args) => {
|
||||
var sortCol:string = args.sortCols[0].sortCol.field;
|
||||
});
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
""
|
||||
4
slickgrid/SlickGrid.d.ts
vendored
4
slickgrid/SlickGrid.d.ts
vendored
@@ -424,7 +424,7 @@ declare module Slick {
|
||||
/**
|
||||
* The editor for cell edits {TextEditor, IntegerEditor, DateEditor...} See slick.editors.js
|
||||
**/
|
||||
editor?: Editors.Editor<T>;
|
||||
editor?: any; // typeof Editors.Editor<T>;
|
||||
|
||||
/**
|
||||
* The property name in the data object to pull content from. (This is assumed to be on the root of the data object.)
|
||||
@@ -1333,7 +1333,7 @@ declare module Slick {
|
||||
|
||||
// todo: merge with existing column definition
|
||||
export interface Column<T extends SlickData> {
|
||||
sortCol?: string;
|
||||
sortCol?: Column<T>;
|
||||
sortAsc?: boolean;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user