This is pretty much identical to how W3C and jQuery implement events.
14 | * @class EventData
15 | * @constructor
16 | **/
17 | export class EventData {
18 |
19 | constructor();
20 |
21 | /***
22 | * Stops event from propagating up the DOM tree.
23 | * @method stopPropagation
24 | */
25 | public stopPropagation(): void;
26 |
27 | /***
28 | * Returns whether stopPropagation was called on this event object.
29 | * @method isPropagationStopped
30 | * @return {Boolean}
31 | */
32 | public isPropagationStopped(): boolean;
33 |
34 | /***
35 | * Prevents the rest of the handlers from being executed.
36 | * @method stopImmediatePropagation
37 | */
38 | public stopImmediatePropagation(): void;
39 |
40 | /***
41 | * Returns whether stopImmediatePropagation was called on this event object.\
42 | * @method isImmediatePropagationStopped
43 | * @return {Boolean}
44 | */
45 | public isImmediatePropagationStopped(): boolean;
46 | }
47 |
48 | /***
49 | * A simple publisher-subscriber implementation.
50 | * @class Event
51 | * @constructor
52 | */
53 | export class Event {
54 |
55 | constructor();
56 |
57 | /***
58 | * Adds an event handler to be called when the event is fired.
59 | * Event handler will receive two arguments - an EventData and the data
60 | * object the event was fired with.
61 | * @method subscribe
62 | * @param fn {Function} Event handler.
63 | */
64 | public subscribe(fn: (e: EventData, data: T) => any): void;
65 | public subscribe(fn: (e: DOMEvent, data: T) => any): void;
66 |
67 | /***
68 | * Removes an event handler added with subscribe(fn).
69 | * @method unsubscribe
70 | * @param fn {Function} Event handler to be removed.
71 | */
72 | public unsubscribe(fn: (e: EventData, data: T) => any): void;
73 | public unsubscribe(fn: (e: DOMEvent, data: T) => any): void;
74 |
75 | /***
76 | * Fires an event notifying all subscribers.
77 | * @method notify
78 | * @param args {Object} Additional data object to be passed to all handlers.
79 | * @param e {EventData}
80 | * Optional.
81 | * An EventData object to be passed to all handlers.
82 | * For DOM events, an existing W3C/jQuery event object can be passed in.
83 | * @param scope {Object}
84 | * Optional.
85 | * The scope ("this") within which the handler will be executed.
86 | * If not specified, the scope will be set to the Event instance.
87 | * @return Last run callback result.
88 | * @note slick.core.Event.notify shows this method as returning a value, type is unknown.
89 | */
90 | public notify(args?: T, e?: EventData, scope?: any): any;
91 | public notify(args?: T, e?: DOMEvent, scope?: any): any;
92 |
93 | }
94 |
95 | // todo: is this private? there are no comments in the code
96 | export class EventHandler {
97 | constructor();
98 |
99 | public subscribe(event: EventData, handler: Function): EventHandler;
100 | public unsubscribe(event: EventData, handler: Function): EventHandler;
101 | public unsubscribeAll(): EventHandler;
102 | }
103 |
104 | /***
105 | * A structure containing a range of cells.
106 | * @class Range
107 | **/
108 | export class Range {
109 |
110 | /**
111 | * A structure containing a range of cells.
112 | * @constructor
113 | * @param fromRow {Integer} Starting row.
114 | * @param fromCell {Integer} Starting cell.
115 | * @param toRow {Integer} Optional. Ending row. Defaults to fromRow.
116 | * @param toCell {Integer} Optional. Ending cell. Defaults to fromCell.
117 | **/
118 | constructor(fromRow: number, fromCell: number, toRow?: number, toCell?: number);
119 |
120 | /***
121 | * @property fromRow
122 | * @type {Integer}
123 | */
124 | public fromRow: number;
125 |
126 | /***
127 | * @property fromCell
128 | * @type {Integer}
129 | */
130 | public fromCell: number;
131 |
132 | /***
133 | * @property toRow
134 | * @type {Integer}
135 | */
136 | public toRow: number;
137 |
138 | /***
139 | * @property toCell
140 | * @type {Integer}
141 | */
142 | public toCell: number;
143 |
144 | /***
145 | * Returns whether a range represents a single row.
146 | * @method isSingleRow
147 | * @return {Boolean}
148 | */
149 | public isSingleRow(): boolean;
150 |
151 | /***
152 | * Returns whether a range represents a single cell.
153 | * @method isSingleCell
154 | * @return {Boolean}
155 | */
156 | public isSingleCell(): boolean;
157 |
158 | /***
159 | * Returns whether a range contains a given cell.
160 | * @method contains
161 | * @param row {Integer}
162 | * @param cell {Integer}
163 | * @return {Boolean}
164 | */
165 | public contains(row: number, cell: number): boolean;
166 |
167 | /***
168 | * Returns a readable representation of a range.
169 | * @method toString
170 | * @return {String}
171 | */
172 | public toString(): string;
173 |
174 | }
175 |
176 | /***
177 | * A base class that all special / non-data rows (like Group and GroupTotals) derive from.
178 | * @class NonDataItem
179 | * @constructor
180 | */
181 | export class NonDataRow {
182 |
183 | }
184 |
185 | /***
186 | * Information about a group of rows.
187 | * @class Group
188 | * @extends Slick.NonDataItem
189 | * @constructor
190 | */
191 | export class Group extends NonDataRow {
192 |
193 | constructor();
194 |
195 | /**
196 | * Grouping level, starting with 0.
197 | * @property level
198 | * @type {Number}
199 | */
200 | public level: number;
201 |
202 | /***
203 | * Number of rows in the group.
204 | * @property count
205 | * @type {Integer}
206 | */
207 | public count: number;
208 |
209 | /***
210 | * Grouping value.
211 | * @property value
212 | * @type {Object}
213 | */
214 | public value: any;
215 |
216 | /***
217 | * Formatted display value of the group.
218 | * @property title
219 | * @type {String}
220 | */
221 | public title: string;
222 |
223 | /***
224 | * Whether a group is collapsed.
225 | * @property collapsed
226 | * @type {Boolean}
227 | */
228 | public collapsed: boolean;
229 |
230 | /***
231 | * GroupTotals, if any.
232 | * @property totals
233 | * @type {GroupTotals}
234 | */
235 | public totals: GroupTotals;
236 |
237 | /**
238 | * Rows that are part of the group.
239 | * @property rows
240 | * @type {Array}
241 | */
242 | public rows: T[];
243 |
244 | /**
245 | * Sub-groups that are part of the group.
246 | * @property groups
247 | * @type {Array}
248 | */
249 | public groups: Group[];
250 |
251 | /**
252 | * A unique key used to identify the group. This key can be used in calls to DataView
253 | * collapseGroup() or expandGroup().
254 | * @property groupingKey
255 | * @type {Object}
256 | */
257 | public groupingKey: any;
258 |
259 | /***
260 | * Compares two Group instances.
261 | * @method equals
262 | * @return {Boolean}
263 | * @param group {Group} Group instance to compare to.
264 | * todo: this is on the prototype (NonDataRow()) instance, not Group, maybe doesn't matter?
265 | */
266 | public equals(group: Group): boolean;
267 | }
268 |
269 | /***
270 | * Information about group totals.
271 | * An instance of GroupTotals will be created for each totals row and passed to the aggregators
272 | * so that they can store arbitrary data in it. That data can later be accessed by group totals
273 | * formatters during the display.
274 | * @class GroupTotals
275 | * @extends Slick.NonDataItem
276 | * @constructor
277 | */
278 | export class GroupTotals extends NonDataRow {
279 |
280 | constructor();
281 |
282 | /***
283 | * Parent Group.
284 | * @param group
285 | * @type {Group}
286 | */
287 | public group: Group;
288 |
289 | }
290 |
291 | /***
292 | * A locking helper to track the active edit controller and ensure that only a single controller
293 | * can be active at a time. This prevents a whole class of state and validation synchronization
294 | * issues. An edit controller (such as SlickGrid) can query if an active edit is in progress
295 | * and attempt a commit or cancel before proceeding.
296 | * @class EditorLock
297 | * @constructor
298 | */
299 | export class EditorLock {
300 |
301 | constructor();
302 |
303 | /***
304 | * Returns true if a specified edit controller is active (has the edit lock).
305 | * If the parameter is not specified, returns true if any edit controller is active.
306 | * @method isActive
307 | * @param editController {EditController}
308 | * @return {Boolean}
309 | */
310 | public isActive(editController: Editors.Editor): boolean;
311 |
312 | /***
313 | * Sets the specified edit controller as the active edit controller (acquire edit lock).
314 | * If another edit controller is already active, and exception will be thrown.
315 | * @method activate
316 | * @param editController {EditController} edit controller acquiring the lock
317 | */
318 | public activate(editController: Editors.Editor): void;
319 |
320 | /***
321 | * Unsets the specified edit controller as the active edit controller (release edit lock).
322 | * If the specified edit controller is not the active one, an exception will be thrown.
323 | * @method deactivate
324 | * @param editController {EditController} edit controller releasing the lock
325 | */
326 | public deactivate(editController: Editors.Editor): void;
327 |
328 | /***
329 | * Attempts to commit the current edit by calling "commitCurrentEdit" method on the active edit
330 | * controller and returns whether the commit attempt was successful (commit may fail due to validation
331 | * errors, etc.). Edit controller's "commitCurrentEdit" must return true if the commit has succeeded
332 | * and false otherwise. If no edit controller is active, returns true.
333 | * @method commitCurrentEdit
334 | * @return {Boolean}
335 | */
336 | public commitCurrentEdit(): boolean;
337 |
338 | /***
339 | * Attempts to cancel the current edit by calling "cancelCurrentEdit" method on the active edit
340 | * controller and returns whether the edit was successfully cancelled. If no edit controller is
341 | * active, returns true.
342 | * @method cancelCurrentEdit
343 | * @return {Boolean}
344 | */
345 | public cancelCurrentEdit(): boolean;
346 | }
347 |
348 | /**
349 | * A global singleton editor lock.
350 | * @class GlobalEditorLock
351 | * @static
352 | * @constructor
353 | **/
354 | export var GlobalEditorLock: EditorLock;
355 |
356 | /**
357 | * slick.grid.js
358 | **/
359 |
360 | /**
361 | * Options which you can apply to the columns objects.
362 | **/
363 | export interface Column {
364 |
365 | /**
366 | * This accepts a function of the form function(cellNode, row, dataContext, colDef) and is used to post-process the cell's DOM node / nodes
367 | * @param cellNode
368 | * @param row
369 | * @param dataContext
370 | * @param colDef
371 | * @return
372 | **/
373 | asyncPostRender?: (cellNode:any, row:any, dataContext:any, colDef:any) => void;
374 |
375 | /**
376 | * Used by the the slick.rowMoveManager.js plugin for moving rows. Has no effect without the plugin installed.
377 | **/
378 | behavior?: any;
379 |
380 | /**
381 | * In the "Add New" row, determines whether clicking cells in this column can trigger row addition. If true, clicking on the cell in this column in the "Add New" row will not trigger row addition.
382 | **/
383 | cannotTriggerInsert?: boolean;
384 |
385 | /**
386 | * Accepts a string as a class name, applies that class to every row cell in the column.
387 | **/
388 | cssClass?: string;
389 |
390 | /**
391 | * When set to true, the first user click on the header will do a descending sort. When set to false, the first user click on the header will do an ascending sort.
392 | **/
393 | defaultSortAsc?: boolean;
394 |
395 | /**
396 | * The editor for cell edits {TextEditor, IntegerEditor, DateEditor...} See slick.editors.js
397 | **/
398 | editor?: any; // typeof Editors.Editor;
399 |
400 | /**
401 | * The property name in the data object to pull content from. (This is assumed to be on the root of the data object.)
402 | **/
403 | field?: string;
404 |
405 | /**
406 | * When set to false, clicking on a cell in this column will not select the row for that cell. The cells in this column will also be skipped during tab navigation.
407 | **/
408 | focusable?: boolean;
409 |
410 | /**
411 | * This accepts a function of the form function(row, cell, value, columnDef, dataContext) and returns a formatted version of the data in each cell of this column. For example, setting formatter to function(r, c, v, cd, dc) { return "Hello!"; } would overwrite every value in the column with "Hello!" See defaultFormatter in slick.grid.js for an example formatter.
412 | * @param row
413 | * @param cell
414 | * @param value
415 | * @param columnDef
416 | * @param dataContext
417 | * @return
418 | **/
419 | formatter?: Formatter;
420 |
421 | /**
422 | * Accepts a string as a class name, applies that class to the cell for the column header.
423 | **/
424 | headerCssClass?: string;
425 |
426 | /**
427 | * A unique identifier for the column within the grid.
428 | **/
429 | id?: string;
430 |
431 | /**
432 | * Set the maximum allowable width of this column, in pixels.
433 | **/
434 | maxWidth?: number;
435 |
436 | /**
437 | * Set the minimum allowable width of this column, in pixels.
438 | **/
439 | minWidth?: number;
440 |
441 | /**
442 | * The text to display on the column heading.
443 | **/
444 | name?: string;
445 |
446 | /**
447 | * If set to true, whenever this column is resized, the entire table view will rerender.
448 | **/
449 | rerenderOnResize?: boolean;
450 |
451 | /**
452 | * If false, column can no longer be resized.
453 | **/
454 | resizable?: boolean;
455 |
456 | /**
457 | * If false, when a row is selected, the CSS class for selected cells ("selected" by default) is not applied to the cell in this column.
458 | **/
459 | selectable?: boolean;
460 |
461 | /**
462 | * If true, the column will be sortable by clicking on the header.
463 | **/
464 | sortable?: boolean;
465 |
466 | /**
467 | * If set to a non-empty string, a tooltip will appear on hover containing the string.
468 | **/
469 | toolTip?: string;
470 |
471 | /**
472 | * Width of the column in pixels. (May often be overridden by things like minWidth, maxWidth, forceFitColumns, etc.)
473 | **/
474 | width?: number;
475 | }
476 |
477 | export interface EditorFactory {
478 | getEditor(column: Column): Editors.Editor;
479 | }
480 |
481 | export interface FormatterFactory {
482 | getFormatter(column: Column): Formatter;
483 | }
484 |
485 | export interface GridOptions {
486 |
487 | /**
488 | * Makes cell editors load asynchronously after a small delay. This greatly increases keyboard navigation speed.
489 | **/
490 | asyncEditorLoading?: boolean;
491 |
492 | /**
493 | * Delay after which cell editor is loaded. Ignored unless asyncEditorLoading is true.
494 | **/
495 | asyncEditorLoadDelay?: number;
496 |
497 | /**
498 | *
499 | **/
500 | asyncPostRenderDelay?: number;
501 |
502 | /**
503 | * Cell will not automatically go into edit mode when selected.
504 | **/
505 | autoEdit?: boolean;
506 |
507 | /**
508 | *
509 | **/
510 | autoHeight?: boolean;
511 |
512 | /**
513 | * A CSS class to apply to flashing cells via flashCell().
514 | **/
515 | cellFlashingCssClass?: string;
516 |
517 | /**
518 | * A CSS class to apply to cells highlighted via setHighlightedCells().
519 | **/
520 | cellHighlightCssClass?: string;
521 |
522 | /**
523 | *
524 | **/
525 | dataItemColumnValueExtractor?: any;
526 |
527 | /**
528 | *
529 | **/
530 | defaultColumnWidth?: number;
531 |
532 | /**
533 | *
534 | **/
535 | defaultFormatter?: Formatter;
536 |
537 | /**
538 | *
539 | **/
540 | editable?: boolean;
541 |
542 | /**
543 | * Not listed as a default under options in slick.grid.js
544 | **/
545 | editCommandHandler?: any; // queueAndExecuteCommand
546 |
547 | /**
548 | * A factory object responsible to creating an editor for a given cell. Must implement getEditor(column).
549 | **/
550 | editorFactory?: EditorFactory;
551 |
552 | /**
553 | * A Slick.EditorLock instance to use for controlling concurrent data edits.
554 | **/
555 | editorLock?: EditorLock;
556 |
557 | /**
558 | * If true, a blank row will be displayed at the bottom - typing values in that row will add a new one. Must subscribe to onAddNewRow to save values.
559 | **/
560 | enableAddRow?: boolean;
561 |
562 | /**
563 | * If true, async post rendering will occur and asyncPostRender delegates on columns will be called.
564 | **/
565 | enableAsyncPostRender?: boolean;
566 |
567 | /**
568 | * *WARNING*: Not contained in SlickGrid 2.1, may be deprecated
569 | **/
570 | enableCellRangeSelection?: any;
571 |
572 | /**
573 | * Appears to enable cell virtualisation for optimised speed with large datasets
574 | **/
575 | enableCellNavigation?: boolean;
576 |
577 | /**
578 | *
579 | **/
580 | enableColumnReorder?: boolean;
581 |
582 | /**
583 | * *WARNING*: Not contained in SlickGrid 2.1, may be deprecated
584 | **/
585 | enableRowReordering?: any;
586 |
587 | /**
588 | *
589 | **/
590 | enableTextSelectionOnCells?: boolean;
591 |
592 | /**
593 | * @see Example: Explicit Initialization
594 | **/
595 | explicitInitialization?: boolean;
596 |
597 | /**
598 | * Force column sizes to fit into the container (preventing horizontal scrolling). Effectively sets column width to be 1/Number of Columns which on small containers may not be desirable
599 | **/
600 | forceFitColumns?: boolean;
601 |
602 | /**
603 | *
604 | **/
605 | forceSyncScrolling?: boolean;
606 |
607 | /**
608 | * A factory object responsible to creating a formatter for a given cell. Must implement getFormatter(column).
609 | **/
610 | formatterFactory?: FormatterFactory;
611 |
612 | /**
613 | * Will expand the table row divs to the full width of the container, table cell divs will remain aligned to the left
614 | **/
615 | fullWidthRows?: boolean;
616 |
617 | /**
618 | *
619 | **/
620 | headerRowHeight?: number;
621 |
622 | /**
623 | *
624 | **/
625 | leaveSpaceForNewRows?: boolean;
626 |
627 | /**
628 | * @see Example: Multi-Column Sort
629 | **/
630 | multiColumnSort?: boolean;
631 |
632 | /**
633 | *
634 | **/
635 | multiSelect?: boolean;
636 |
637 | /**
638 | *
639 | **/
640 | rowHeight?: number;
641 |
642 | /**
643 | *
644 | **/
645 | selectedCellCssClass?: string;
646 |
647 | /**
648 | *
649 | **/
650 | showHeaderRow?: boolean;
651 |
652 | /**
653 | * If true, the column being resized will change its width as the mouse is dragging the resize handle. If false, the column will resize after mouse drag ends.
654 | **/
655 | syncColumnCellResize?: boolean;
656 |
657 | /**
658 | *
659 | **/
660 | topPanelHeight?: number;
661 | }
662 |
663 | export interface DataProvider {
664 | /**
665 | * Returns the number of data items in the set.
666 | */
667 | getLength(): number;
668 |
669 | /**
670 | * Returns the item at a given index.
671 | * @param index
672 | */
673 | getItem(index: number): T;
674 |
675 | /**
676 | * Returns the metadata for the item at a given index (optional).
677 | * @param index
678 | */
679 | getItemMetadata?(index: number): RowMetadata;
680 | }
681 |
682 | export interface SlickData {
683 | // todo ? might be able to leave as empty
684 | }
685 |
686 | export interface RowMetadata {
687 | /**
688 | * One or more (space-separated) CSS classes to be added to the entire row.
689 | */
690 | cssClasses?: string;
691 |
692 | /**
693 | * Whether or not any cells in the row can be set as "active".
694 | */
695 | focusable?: boolean;
696 |
697 | /**
698 | * Whether or not a row or any cells in it can be selected.
699 | */
700 | selectable?: boolean;
701 |
702 | /**
703 | * Metadata related to individual columns
704 | */
705 | columns?: {
706 | /**
707 | * Metadata indexed by column id
708 | */
709 | [index: string]: ColumnMetadata;
710 | /**
711 | * Metadata indexed by column index
712 | */
713 | [index: number]: ColumnMetadata;
714 | }
715 | }
716 |
717 | export interface ColumnMetadata {
718 | /**
719 | * Whether or not a cell can be set as "active".
720 | */
721 | focusable?: boolean;
722 |
723 | /**
724 | * Whether or not a cell can be selected.
725 | */
726 | selectable?: boolean;
727 |
728 | /**
729 | * A custom cell formatter.
730 | */
731 | formatter?: Formatter;
732 |
733 | /**
734 | * A custom cell editor.
735 | */
736 | editor?: Slick.Editors.Editor;
737 |
738 | /**
739 | * Number of columns this cell will span. Can also contain "*" to indicate that the cell should span the rest of the row.
740 | */
741 | colspan?: number|string;
742 | }
743 |
744 | /**
745 | * Selecting cells in SlickGrid is handled by a selection model.
746 | * Selection models are controllers responsible for handling user interactions and notifying subscribers of the changes in the selection. Selection is represented as an array of Slick.Range objects.
747 | * You can get the current selection model from the grid by calling getSelectionModel() and set a different one using setSelectionModel(selectionModel). By default, no selection model is set.
748 | * The grid also provides two helper methods to simplify development - getSelectedRows() and setSelectedRows(rowsArray), as well as an onSelectedRowsChanged event.
749 | * SlickGrid includes two pre-made selection models - Slick.CellSelectionModel and Slick.RowSelectionModel, but you can easily write a custom one.
750 | **/
751 | export class SelectionModel {
752 | /**
753 | * An initializer function that will be called with an instance of the grid whenever a selection model is registered with setSelectionModel. The selection model can use this to initialize its state and subscribe to grid events.
754 | **/
755 | init(grid: Grid): void;
756 |
757 | /**
758 | * A destructor function that will be called whenever a selection model is unregistered from the grid by a call to setSelectionModel with another selection model or whenever a grid with this selection model is destroyed. The selection model can use this destructor to unsubscribe from grid events and release all resources (remove DOM nodes, event listeners, etc.).
759 | **/
760 | destroy(): void;
761 |
762 | onSelectedRangesChanged: Slick.Event;
763 |
764 | getSelectedRanges?(): Array;
765 |
766 | setSelectedRanges?(ranges: Array);
767 | }
768 |
769 | export class Grid {
770 |
771 | /**
772 | * Create an instance of the grid.
773 | * @param container Container node to create the grid in. This can be a DOM Element, a jQuery node, or a jQuery selector.
774 | * @param data Databinding source. This can either be a regular JavaScript array or a custom object exposing getItem(index) and getLength() functions.
775 | * @param columns An array of column definition objects. See Column Options for a list of options that can be included on each column definition object.
776 | * @param options Additional options. See Grid Options for a list of options that can be included.
777 | **/
778 | constructor(
779 | container: string|HTMLElement|JQuery,
780 | data: T[]|DataProvider,
781 | columns: Column[],
782 | options: GridOptions);
783 |
784 | // #region Core
785 |
786 | /**
787 | * Initializes the grid. Called after plugins are registered. Normally, this is called by the constructor, so you don't need to call it. However, in certain cases you may need to delay the initialization until some other process has finished. In that case, set the explicitInitialization option to true and call the grid.init() manually.
788 | **/
789 | public init(): void;
790 |
791 | /**
792 | * todo: no docs
793 | **/
794 | public destroy(): void;
795 |
796 | /**
797 | * Returns an array of every data object, unless you're using DataView in which case it returns a DataView object.
798 | * @return
799 | **/
800 | public getData(): any;
801 | //public getData(): T[];
802 | // Issue: typescript limitation, cannot differentiate calls by return type only, so need to cast to DataView or T[].
803 | //public getData(): DataView;
804 |
805 | /**
806 | * Returns the databinding item at a given position.
807 | * @param index Item index.
808 | * @return
809 | **/
810 | public getDataItem(index: number): T;
811 |
812 | /**
813 | * Sets a new source for databinding and removes all rendered rows. Note that this doesn't render the new rows - you can follow it with a call to render() to do that.
814 | * @param newData New databinding source using a regular JavaScript array..
815 | * @param scrollToTop If true, the grid will reset the vertical scroll position to the top of the grid.
816 | **/
817 | public setData(newData: T[], scrollToTop: boolean): void;
818 |
819 | /**
820 | * Sets a new source for databinding and removes all rendered rows. Note that this doesn't render the new rows - you can follow it with a call to render() to do that.
821 | * @param newData New databinding source using a custom object exposing getItem(index) and getLength() functions.
822 | * @param scrollToTop If true, the grid will reset the vertical scroll position to the top of the grid.
823 | **/
824 | public setData(newData: DataProvider, scrollToTop: boolean): void;
825 |
826 | /**
827 | * Returns the size of the databinding source.
828 | * @return
829 | **/
830 | public getDataLength(): number;
831 |
832 | /**
833 | * Returns an object containing all of the Grid options set on the grid. See a list of Grid Options here.
834 | * @return
835 | **/
836 | public getOptions(): GridOptions;
837 |
838 | /**
839 | * Returns an array of row indices corresponding to the currently selected rows.
840 | * @return
841 | **/
842 | public getSelectedRows(): number[];
843 |
844 | /**
845 | * Returns the current SelectionModel. See here for more information about SelectionModels.
846 | * @return
847 | **/
848 | public getSelectionModel(): SelectionModel;
849 |
850 | public invalidateRows(rows: number[], keepEditor: boolean): void;
851 |
852 | /**
853 | * Extends grid options with a given hash. If an there is an active edit, the grid will attempt to commit the changes and only continue if the attempt succeeds.
854 | * @options An object with configuration options.
855 | **/
856 | public setOptions(options: GridOptions): void;
857 |
858 | /**
859 | * Accepts an array of row indices and applies the current selectedCellCssClass to the cells in the row, respecting whether cells have been flagged as selectable.
860 | * @param rowsArray An array of row numbers.
861 | **/
862 | public setSelectedRows(rowsArray: number[]): void;
863 |
864 | /**
865 | * Unregisters a current selection model and registers a new one. See the definition of SelectionModel for more information.
866 | * @selectionModel A SelectionModel.
867 | **/
868 | public setSelectionModel(selectionModel: SelectionModel): void; // todo: don't know the type of the event data type
869 |
870 | // #endregion Core
871 |
872 | // #region Columns
873 |
874 | /**
875 | * Proportionately resizes all columns to fill available horizontal space. This does not take the cell contents into consideration.
876 | **/
877 | public autosizeColumns(): void;
878 |
879 | /**
880 | * Returns the index of a column with a given id. Since columns can be reordered by the user, this can be used to get the column definition independent of the order:
881 | * @param id A column id.
882 | * @return
883 | **/
884 | public getColumnIndex(id: string): number;
885 |
886 | /**
887 | * Returns an array of column definitions, containing the option settings for each individual column.
888 | * @return
889 | **/
890 | public getColumns(): Column[];
891 |
892 | /**
893 | * Returns an array of the widths of the columns
894 | * @return
895 | */
896 | public getColumnWidths(): number[];
897 |
898 | /**
899 | * Sets grid columns. Column headers will be recreated and all rendered rows will be removed. To rerender the grid (if necessary), call render().
900 | * @param columnDefinitions An array of column definitions.
901 | **/
902 | public setColumns(columnDefinitions: Column[]): void;
903 |
904 | public setColumnWidths(columnDefinitions: Column[]): void;
905 |
906 | /**
907 | * Accepts a columnId string and an ascending boolean. Applies a sort glyph in either ascending or descending form to the header of the column. Note that this does not actually sort the column. It only adds the sort glyph to the header.
908 | * @param columnId
909 | * @param ascending
910 | **/
911 | public setSortColumn(columnId: string, ascending: boolean): void;
912 |
913 | /**
914 | * Accepts an array of objects in the form [ { columnId: [string], sortAsc: [boolean] }, ... ]. When called, this will apply a sort glyph in either ascending or descending form to the header of each column specified in the array. Note that this does not actually sort the column. It only adds the sort glyph to the header
915 | * @param cols
916 | **/
917 | public setSortColumns(cols: { columnId: string; sortAsc: boolean }[]): void;
918 |
919 | /**
920 | * todo: no docs or comments available
921 | * @return
922 | **/
923 | public getSortColumns(): { columnId: string; sortAsc: boolean }[];
924 |
925 | /**
926 | * Updates an existing column definition and a corresponding header DOM element with the new title and tooltip.
927 | * @param columnId Column id.
928 | * @param title New column name.
929 | * @param toolTip New column tooltip.
930 | **/
931 | public updateColumnHeader(columnId: string, title?: string, toolTip?: string): void;
932 |
933 | // #endregion Columns
934 |
935 | // #region Cells
936 |
937 | /**
938 | * Adds an "overlay" of CSS classes to cell DOM elements. SlickGrid can have many such overlays associated with different keys and they are frequently used by plugins. For example, SlickGrid uses this method internally to decorate selected cells with selectedCellCssClass (see options).
939 | * @param key A unique key you can use in calls to setCellCssStyles and removeCellCssStyles. If a hash with that key has already been set, an exception will be thrown.
940 | * @param hash A hash of additional cell CSS classes keyed by row number and then by column id. Multiple CSS classes can be specified and separated by space.
941 | * @example
942 | * {
943 | * 0: {
944 | * "number_column": "cell-bold",
945 | * "title_column": "cell-title cell-highlighted"
946 | * },
947 | * 4: {
948 | * "percent_column": "cell-highlighted"
949 | * }
950 | * }
951 | **/
952 | public addCellCssStyles(key: string, hash: CellCssStylesHash): void;
953 |
954 | /**
955 | * Returns true if you can click on a given cell and make it the active focus.
956 | * @param row A row index.
957 | * @param col A column index.
958 | * @return
959 | **/
960 | public canCellBeActive(row: number, col: number): boolean;
961 |
962 | /**
963 | * Returns true if selecting the row causes this particular cell to have the selectedCellCssClass applied to it. A cell can be selected if it exists and if it isn't on an empty / "Add New" row and if it is not marked as "unselectable" in the column definition.
964 | * @param row A row index.
965 | * @param col A column index.
966 | * @return
967 | **/
968 | public canCellBeSelected(row: number, col: number): boolean;
969 |
970 | /**
971 | * Attempts to switch the active cell into edit mode. Will throw an error if the cell is set to be not editable. Uses the specified editor, otherwise defaults to any default editor for that given cell.
972 | * @param editor A SlickGrid editor (see examples in slick.editors.js).
973 | **/
974 | public editActiveCell(editor: Editors.Editor): void;
975 |
976 | /**
977 | * Flashes the cell twice by toggling the CSS class 4 times.
978 | * @param row A row index.
979 | * @param cell A column index.
980 | * @param speed (optional) - The milliseconds delay between the toggling calls. Defaults to 100 ms.
981 | **/
982 | public flashCell(row: number, cell: number, speed?: number): void;
983 |
984 | /**
985 | * Returns an object representing the coordinates of the currently active cell:
986 | * @example
987 | * {
988 | * row: activeRow,
989 | * cell: activeCell
990 | * }
991 | * @return
992 | **/
993 | public getActiveCell(): Cell;
994 |
995 | /**
996 | *
997 | */
998 | public editActiveCell(editor?: Editors.Editor, preClickModeOn?: boolean): void;
999 |
1000 | /**
1001 | * Returns the DOM element containing the currently active cell. If no cell is active, null is returned.
1002 | * @return
1003 | **/
1004 | public getActiveCellNode(): HTMLElement;
1005 |
1006 | /**
1007 | * Returns an object representing information about the active cell's position. All coordinates are absolute and take into consideration the visibility and scrolling position of all ancestors.
1008 | * @return
1009 | **/
1010 | public getActiveCellPosition(): CellPosition;
1011 |
1012 | /**
1013 | * Accepts a key name, returns the group of CSS styles defined under that name. See setCellCssStyles for more info.
1014 | * @param key A string.
1015 | * @return
1016 | **/
1017 | public getCellCssStyles(key: string): CellCssStylesHash;
1018 |
1019 | /**
1020 | * Returns the active cell editor. If there is no actively edited cell, null is returned.
1021 | * @return
1022 | **/
1023 | public getCellEditor(): Editors.Editor;
1024 |
1025 | /**
1026 | * Returns a hash containing row and cell indexes from a standard W3C/jQuery event.
1027 | * @param e A standard W3C/jQuery event.
1028 | * @return
1029 | **/
1030 | public getCellFromEvent(e: DOMEvent): Cell;
1031 |
1032 | /**
1033 | * Returns a hash containing row and cell indexes. Coordinates are relative to the top left corner of the grid beginning with the first row (not including the column headers).
1034 | * @param x An x coordinate.
1035 | * @param y A y coordinate.
1036 | * @return
1037 | **/
1038 | public getCellFromPoint(x: number, y: number): Cell;
1039 |
1040 | /**
1041 | * Returns a DOM element containing a cell at a given row and cell.
1042 | * @param row A row index.
1043 | * @param cell A column index.
1044 | * @return
1045 | **/
1046 | public getCellNode(row: number, cell: number): HTMLElement;
1047 |
1048 | /**
1049 | * Returns an object representing information about a cell's position. All coordinates are absolute and take into consideration the visibility and scrolling position of all ancestors.
1050 | * @param row A row index.
1051 | * @param cell A column index.
1052 | * @return
1053 | **/
1054 | public getCellNodeBox(row: number, cell: number): CellPosition;
1055 |
1056 | /**
1057 | * Accepts a row integer and a cell integer, scrolling the view to the row where row is its row index, and cell is its cell index. Optionally accepts a forceEdit boolean which, if true, will attempt to initiate the edit dialogue for the field in the specified cell.
1058 | * Unlike setActiveCell, this scrolls the row into the viewport and sets the keyboard focus.
1059 | * @param row A row index.
1060 | * @param cell A column index.
1061 | * @param forceEdit If true, will attempt to initiate the edit dialogue for the field in the specified cell.
1062 | * @return
1063 | **/
1064 | public gotoCell(row: number, cell: number, forceEdit?: boolean): void;
1065 |
1066 | /**
1067 | * todo: no docs
1068 | * @return
1069 | **/
1070 | public getTopPanel(): HTMLElement;
1071 |
1072 | /**
1073 | * todo: no docs
1074 | * @param visible
1075 | **/
1076 | public setTopPanelVisibility(visible: boolean): void;
1077 |
1078 | /**
1079 | * todo: no docs
1080 | * @param visible
1081 | **/
1082 | public setHeaderRowVisibility(visible: boolean): void;
1083 |
1084 | /**
1085 | * todo: no docs
1086 | * @return
1087 | **/
1088 | public getHeaderRow(): HTMLElement;
1089 |
1090 | public getScrollbarDimensions(): Dimension;
1091 |
1092 | /**
1093 | * todo: no docs, return type is probably wrong -> "return $header && $header[0]"
1094 | * @param columnId
1095 | * @return
1096 | **/
1097 | public getHeaderRowColumn(columnId: string): Column;
1098 |
1099 | /**
1100 | * todo: no docs
1101 | * @return
1102 | **/
1103 | public getGridPosition(): CellPosition;
1104 |
1105 | /**
1106 | * Switches the active cell one row down skipping unselectable cells. Returns a boolean saying whether it was able to complete or not.
1107 | * @return
1108 | **/
1109 | public navigateDown(): boolean;
1110 |
1111 | /**
1112 | * Switches the active cell one cell left skipping unselectable cells. Unline navigatePrev, navigateLeft stops at the first cell of the row. Returns a boolean saying whether it was able to complete or not.
1113 | * @return
1114 | **/
1115 | public navigateLeft(): boolean;
1116 |
1117 | /**
1118 | * Tabs over active cell to the next selectable cell. Returns a boolean saying whether it was able to complete or not.
1119 | * @return
1120 | **/
1121 | public navigateNext(): boolean;
1122 |
1123 | /**
1124 | * Tabs over active cell to the previous selectable cell. Returns a boolean saying whether it was able to complete or not.
1125 | * @return
1126 | **/
1127 | public navigatePrev(): boolean;
1128 |
1129 | /**
1130 | * Switches the active cell one cell right skipping unselectable cells. Unline navigateNext, navigateRight stops at the last cell of the row. Returns a boolean saying whether it was able to complete or not.
1131 | * @return
1132 | **/
1133 | public navigateRight(): boolean;
1134 |
1135 | /**
1136 | * Switches the active cell one row up skipping unselectable cells. Returns a boolean saying whether it was able to complete or not.
1137 | * @return
1138 | **/
1139 | public navigateUp(): boolean;
1140 |
1141 | /**
1142 | * Removes an "overlay" of CSS classes from cell DOM elements. See setCellCssStyles for more.
1143 | * @param key A string key.
1144 | **/
1145 | public removeCellCssStyles(key: string): void;
1146 |
1147 | /**
1148 | * Resets active cell.
1149 | **/
1150 | public resetActiveCell(): void;
1151 |
1152 | /**
1153 | * Sets an active cell.
1154 | * @param row A row index.
1155 | * @param cell A column index.
1156 | **/
1157 | public setActiveCell(row: number, cell: number): void;
1158 |
1159 | /**
1160 | * Sets CSS classes to specific grid cells by calling removeCellCssStyles(key) followed by addCellCssStyles(key, hash). key is name for this set of styles so you can reference it later - to modify it or remove it, for example. hash is a per-row-index, per-column-name nested hash of CSS classes to apply.
1161 | * Suppose you have a grid with columns:
1162 | * ["login", "name", "birthday", "age", "likes_icecream", "favorite_cake"]
1163 | * ...and you'd like to highlight the "birthday" and "age" columns for people whose birthday is today, in this case, rows at index 0 and 9. (The first and tenth row in the grid).
1164 | * @param key A string key. Will overwrite any data already associated with this key.
1165 | * @param hash A hash of additional cell CSS classes keyed by row number and then by column id. Multiple CSS classes can be specified and separated by space.
1166 | **/
1167 | public setCellCssStyles(key: string, hash: CellCssStylesHash): void;
1168 |
1169 | // #endregion Cells
1170 |
1171 | // #region Events
1172 |
1173 | public onScroll: Slick.Event>;
1174 | public onSort: Slick.Event>;
1175 | public onHeaderMouseEnter: Slick.Event>;
1176 | public onHeaderMouseLeave: Slick.Event>;
1177 | public onHeaderContextMenu: Slick.Event>;
1178 | public onHeaderClick: Slick.Event>;
1179 | public onHeaderCellRendered: Slick.Event>;
1180 | public onBeforeHeaderCellDestroy: Slick.Event>;
1181 | public onHeaderRowCellRendered: Slick.Event>;
1182 | public onBeforeHeaderRowCellDestroy: Slick.Event>;
1183 | public onMouseEnter: Slick.Event>;
1184 | public onMouseLeave: Slick.Event>;
1185 | public onClick: Slick.Event>;
1186 | public onDblClick: Slick.Event>;
1187 | public onContextMenu: Slick.Event>;
1188 | public onKeyDown: Slick.Event>;
1189 | public onAddNewRow: Slick.Event>;
1190 | public onValidationError: Slick.Event>;
1191 | public onColumnsReordered: Slick.Event>;
1192 | public onColumnsResized: Slick.Event>;
1193 | public onCellChange: Slick.Event>;
1194 | public onBeforeEditCell: Slick.Event>;
1195 | public onBeforeCellEditorDestroy: Slick.Event>;
1196 | public onBeforeDestroy: Slick.Event>;
1197 | public onActiveCellChanged: Slick.Event>;
1198 | public onActiveCellPositionChanged: Slick.Event>;
1199 | public onDragInit: Slick.Event>;
1200 | public onDragStart: Slick.Event>;
1201 | public onDrag: Slick.Event>;
1202 | public onDragEnd: Slick.Event>;
1203 | public onSelectedRowsChanged: Slick.Event>;
1204 | public onCellCssStylesChanged: Slick.Event>;
1205 | public onViewportChanged: Slick.Event>;
1206 | public onBeforeAppendCell: Slick.Event>;
1207 | public onRendered: Slick.Event>;
1208 | // #endregion Events
1209 |
1210 | // #region Plugins
1211 |
1212 | public registerPlugin(plugin: Plugin): void;
1213 | public unregisterPlugin(plugin: Plugin): void;
1214 |
1215 | // #endregion Plugins
1216 |
1217 | // #region Rendering
1218 |
1219 | public render(): void;
1220 | public invalidate(): void;
1221 | public invalidateRow(row: number): void;
1222 | public invalidateRows(rows: number[]): void;
1223 | public invalidateAllRows(): void;
1224 | public updateCell(row: number, cell: number): void;
1225 | public updateRow(row: number): void;
1226 | public getViewport(viewportTop?: number, viewportLeft?: number): Viewport;
1227 | public getRenderedRange(viewportTop?: number, viewportLeft?: number): Viewport;
1228 | public resizeCanvas(): void;
1229 | public updateRowCount(): void;
1230 | public scrollRowIntoView(row: number, doPaging: boolean): void;
1231 | public scrollRowToTop(row: number): void;
1232 | public scrollCellIntoView(row: number, cell: number, doPaging: boolean): void;
1233 | public getCanvasNode(): HTMLCanvasElement;
1234 | public focus(): void;
1235 |
1236 | // #endregion Rendering
1237 |
1238 | // #region Editors
1239 |
1240 | public getEditorLock(): EditorLock;
1241 | public getEditController(): { commitCurrentEdit():boolean; cancelCurrentEdit():boolean; };
1242 |
1243 | // #endregion Editors
1244 | }
1245 |
1246 | export interface GridEventArgs {
1247 | grid: Grid;
1248 | }
1249 |
1250 | export interface OnCellCssStylesChangedEventArgs extends GridEventArgs {
1251 | key: string;
1252 | hash: CellCssStylesHash;
1253 | }
1254 |
1255 | export interface OnSelectedRowsChangedEventArgs extends GridEventArgs {
1256 | rows: number[];
1257 | }
1258 |
1259 | export interface OnDragEndEventArgs extends GridEventArgs {
1260 | // todo: need to understand $canvas drag event parameter's 'dd' object
1261 | // the documentation is not enlightening
1262 | }
1263 |
1264 | export interface OnDragEventArgs extends GridEventArgs {
1265 | // todo: need to understand $canvas drag event parameter's 'dd' object
1266 | // the documentation is not enlightening
1267 | }
1268 |
1269 | export interface OnDragStartEventArgs extends GridEventArgs {
1270 | // todo: need to understand $canvas drag event parameter's 'dd' object
1271 | // the documentation is not enlightening
1272 | }
1273 |
1274 | export interface OnDragInitEventArgs extends GridEventArgs {
1275 | // todo: need to understand $canvas drag event parameter's 'dd' object
1276 | // the documentation is not enlightening
1277 | }
1278 |
1279 | export interface OnActiveCellPositionChangedEventArgs extends GridEventArgs {
1280 |
1281 | }
1282 |
1283 | export interface OnActiveCellChangedEventArgs extends GridEventArgs {
1284 | row: number;
1285 | cell: number;
1286 | }
1287 |
1288 | export interface OnBeforeDestroyEventArgs extends GridEventArgs {
1289 |
1290 | }
1291 |
1292 | export interface OnBeforeCellEditorDestroyEventArgs extends GridEventArgs {
1293 | editor: Editors.Editor;
1294 | }
1295 |
1296 | export interface OnBeforeEditCellEventArgs extends GridEventArgs {
1297 | row: number;
1298 | cell: number;
1299 | item: T;
1300 | column: Column;
1301 | }
1302 |
1303 | export interface OnCellChangeEventArgs extends GridEventArgs {
1304 | row: number;
1305 | cell: number;
1306 | item: T;
1307 | }
1308 |
1309 | export interface OnColumnsResizedEventArgs extends GridEventArgs {
1310 |
1311 | }
1312 |
1313 | export interface OnColumnsReorderedEventArgs extends GridEventArgs {
1314 |
1315 | }
1316 |
1317 | export interface OnValidationErrorEventArgs extends GridEventArgs {
1318 | editor: Editors.Editor;
1319 | cellNode: HTMLElement;
1320 | validationResults: ValidateResults;
1321 | row: number;
1322 | cell: number;
1323 | column: Column;
1324 | }
1325 |
1326 | export interface OnAddNewRowEventArgs extends GridEventArgs {
1327 | item: T;
1328 | column: Column;
1329 | }
1330 |
1331 | export interface OnKeyDownEventArgs extends GridEventArgs {
1332 | row: number;
1333 | cell: number;
1334 | }
1335 |
1336 | export interface OnContextMenuEventArgs extends GridEventArgs {
1337 |
1338 | }
1339 |
1340 | export interface OnDblClickEventArgs extends GridEventArgs {
1341 | row: number;
1342 | cell: number;
1343 | }
1344 |
1345 | export interface OnClickEventArgs extends GridEventArgs {
1346 | row: number;
1347 | cell: number;
1348 | }
1349 |
1350 | export interface OnMouseLeaveEventArgs extends GridEventArgs {
1351 |
1352 | }
1353 |
1354 | export interface OnMouseEnterEventArgs extends GridEventArgs {
1355 |
1356 | }
1357 |
1358 | export interface OnBeforeHeaderRowCellDestroyEventArgs extends GridEventArgs {
1359 | node: HTMLElement; // todo: might be JQuery instance
1360 | column: Column;
1361 | }
1362 |
1363 | export interface OnHeaderRowCellRenderedEventArgs extends GridEventArgs {
1364 | node: HTMLElement; // todo: might be JQuery instance
1365 | column: Column;
1366 | }
1367 |
1368 | export interface OnBeforeHeaderCellDestroyEventArgs extends GridEventArgs {
1369 | node: HTMLElement; // todo: might be JQuery instance
1370 | column: Column;
1371 | }
1372 |
1373 | export interface OnHeaderCellRenderedEventArgs extends GridEventArgs {
1374 | node: HTMLElement; // todo: might be JQuery instance
1375 | column: Column;
1376 | }
1377 |
1378 | export interface OnHeaderClickEventArgs extends GridEventArgs {
1379 | column: Column;
1380 | }
1381 |
1382 | export interface OnHeaderContextMenuEventArgs extends GridEventArgs {
1383 | column: Column;
1384 | }
1385 |
1386 | export interface OnHeaderMouseEventArgs extends GridEventArgs {
1387 | column: Column;
1388 | }
1389 |
1390 | export interface OnSortEventArgs extends GridEventArgs {
1391 | multiColumnSort: boolean;
1392 |
1393 | // Single column returned
1394 | sortCol?: Column;
1395 | sortAsc: boolean;
1396 |
1397 | // Multiple columns returned
1398 | sortCols?: SortColumn[];
1399 | }
1400 |
1401 | export interface OnScrollEventArgs extends GridEventArgs {
1402 | scrollLeft: number;
1403 | scrollTop: number;
1404 | }
1405 |
1406 | export interface OnViewportChangedEventArgs extends GridEventArgs {
1407 |
1408 | }
1409 |
1410 | export interface OnBeforeAppendCellEventArgs extends GridEventArgs {
1411 | row: number;
1412 | cell: number;
1413 | value: any;
1414 | dataContext: any;
1415 | }
1416 |
1417 | export interface OnRenderedEventArgs extends GridEventArgs {
1418 | startRow: number;
1419 | endRow: number;
1420 | }
1421 |
1422 | export interface SortColumn {
1423 | sortCol: Column;
1424 | sortAsc: boolean;
1425 | }
1426 |
1427 | export interface Cell {
1428 | row: number;
1429 | cell: number;
1430 | }
1431 |
1432 | export interface CellPosition extends Position {
1433 | bottom: number;
1434 | height: number;
1435 | right: number;
1436 | visible: boolean;
1437 | width: number;
1438 | }
1439 |
1440 | export interface Dimension {
1441 | width: number,
1442 | height: number
1443 | }
1444 |
1445 | export interface Position {
1446 | top: number;
1447 | left: number;
1448 | }
1449 |
1450 | export interface CellCssStylesHash {
1451 | [index: number]: {
1452 | [id: string]: string;
1453 | }
1454 | }
1455 |
1456 | export interface Viewport {
1457 | top: number;
1458 | bottom: number;
1459 | leftPx: number;
1460 | rightPx: number;
1461 | }
1462 |
1463 | export interface ValidateResults {
1464 | valid: boolean;
1465 | msg: string;
1466 | }
1467 |
1468 | export module Editors {
1469 |
1470 | export interface EditorOptions {
1471 | column: Column;
1472 | container: HTMLElement;
1473 | grid: Grid;
1474 | }
1475 |
1476 | export class Editor {
1477 | constructor(args: EditorOptions);
1478 | public init(): void;
1479 | public destroy(): void;
1480 | public focus(): void;
1481 | public loadValue(item:any): void; // todo: typeof(item)
1482 | public applyValue(item:any, state: string): void; // todo: typeof(item)
1483 | public isValueChanged(): boolean;
1484 | public serializeValue(): any;
1485 | public validate(): ValidateResults;
1486 | public getValue(): string;
1487 | public setValue(val: string): void;
1488 | }
1489 |
1490 | export class Text extends Editor {
1491 | constructor(args: EditorOptions);
1492 |
1493 | public getValue(): string;
1494 | public setValue(val: string): void;
1495 | public serializeValue(): string;
1496 | }
1497 |
1498 | export class Integer extends Editor {
1499 | constructor(args: EditorOptions);
1500 |
1501 | public serializeValue(): number;
1502 | }
1503 |
1504 | export class Date extends Editor {
1505 | constructor(args: EditorOptions);
1506 |
1507 | public show(): void;
1508 | public hide(): void;
1509 | public position(position: Position): void;
1510 | public serializeValue(): string;
1511 | }
1512 |
1513 | export class YesNoSelect extends Editor {
1514 | constructor(args: EditorOptions);
1515 |
1516 | public serializeValue(): boolean;
1517 | }
1518 |
1519 | export class Checkbox extends Editor {
1520 | constructor(args: EditorOptions);
1521 |
1522 | public serializeValue(): boolean;
1523 |
1524 | }
1525 | export class PercentComplete extends Editor {
1526 | constructor(args: EditorOptions);
1527 |
1528 | public serializeValue(): number;
1529 | }
1530 |
1531 | export class LongText extends Editor {
1532 | constructor(args: EditorOptions);
1533 |
1534 | public handleKeyDown(e: DOMEvent): void;
1535 | public save(): void;
1536 | public cancel(): void;
1537 | public hide(): void;
1538 | public show(): void;
1539 | public position(position: Position): void;
1540 | public serializeValue(): string;
1541 | }
1542 | }
1543 |
1544 | export interface Formatter {
1545 | (row: number, cell: number, value: any, columnDef: Column, dataContext: SlickData): string;
1546 | }
1547 |
1548 | export module Formatters {
1549 | var PercentComplete: Formatter;
1550 | var PercentCompleteBar: Formatter;
1551 | var YesNo: Formatter;
1552 | var Checkmark: Formatter;
1553 | }
1554 |
1555 | export module Data {
1556 |
1557 | export interface DataViewOptions {
1558 | groupItemMetadataProvider?: GroupItemMetadataProvider;
1559 | inlineFilters?: boolean;
1560 | }
1561 |
1562 | /**
1563 | * Item -> Data by index
1564 | * Row -> Data by row
1565 | **/
1566 | export class DataView implements DataProvider