jsl-ui 9.17.0 → 9.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ISlickColumn, ISlickEvent } from "./slick.core";
|
|
2
2
|
import { ISlickGridOptions, ISlickGrid } from "./slick.grid";
|
|
3
3
|
import { ISlickDataView } from "./slick.dataview";
|
|
4
|
+
import { RowMoveManager } from "./plugins/slick.rowmovemanager";
|
|
4
5
|
export interface ISlickCreatorOptions extends ISlickGridOptions {
|
|
5
6
|
primaryKey: string;
|
|
6
7
|
showHeaderMenu?: boolean;
|
|
@@ -18,6 +19,7 @@ export interface ISlickCreatorOptions extends ISlickGridOptions {
|
|
|
18
19
|
allowRowMove?: boolean;
|
|
19
20
|
enableFillDown?: boolean;
|
|
20
21
|
setDataItemValueForColumn?: (item: any, columnDef: ISlickColumn, value: any) => void;
|
|
22
|
+
rowMoveManager: typeof RowMoveManager;
|
|
21
23
|
}
|
|
22
24
|
export interface IJSLGrid<T> extends ISlickGrid<T> {
|
|
23
25
|
dataView: ISlickDataView<T>;
|
|
@@ -22,6 +22,7 @@ export function createJSLGrid(selector, data, columns, option) {
|
|
|
22
22
|
var customCommandHandler;
|
|
23
23
|
var grid;
|
|
24
24
|
var dataView;
|
|
25
|
+
var rowMoveManager;
|
|
25
26
|
//let options: ISlickCreatorOptions;
|
|
26
27
|
function createMe() {
|
|
27
28
|
sanitizeColumns(columns);
|
|
@@ -63,7 +64,7 @@ export function createJSLGrid(selector, data, columns, option) {
|
|
|
63
64
|
}
|
|
64
65
|
setupHeaderButtons();
|
|
65
66
|
if (options.allowRowMove) {
|
|
66
|
-
|
|
67
|
+
this.rowMoveManager = new RowMoveManager({
|
|
67
68
|
cancelEditOnDrag: true,
|
|
68
69
|
singleRowMove: true,
|
|
69
70
|
disableRowSelection: true,
|
|
@@ -71,11 +72,11 @@ export function createJSLGrid(selector, data, columns, option) {
|
|
|
71
72
|
rowMoveShadowScale: 0.7,
|
|
72
73
|
rowMoveShadowOpacity: 0.9 // defaults to 0.95
|
|
73
74
|
});
|
|
74
|
-
grid.registerPlugin(
|
|
75
|
-
|
|
75
|
+
grid.registerPlugin(this.rowMoveManager);
|
|
76
|
+
this.rowMoveManager.onBeforeMoveRows.subscribe(function (e, args) {
|
|
76
77
|
// debugger;
|
|
77
78
|
});
|
|
78
|
-
|
|
79
|
+
this.rowMoveManager.onMoveRows.subscribe(function (e, args) {
|
|
79
80
|
var extractedRows = [], left, right;
|
|
80
81
|
var rows = args.rows;
|
|
81
82
|
var insertBefore = args.insertBefore;
|
|
@@ -712,6 +713,7 @@ export function createJSLGrid(selector, data, columns, option) {
|
|
|
712
713
|
clearFilter: clearFilter,
|
|
713
714
|
refreshFilters: refreshFilters,
|
|
714
715
|
getSelectedItems: getSelectedItems,
|
|
716
|
+
rowMoveManager: rowMoveManager,
|
|
715
717
|
getHeaderMenu: getHeaderMenu // ,
|
|
716
718
|
// setHierachy
|
|
717
719
|
});
|