123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705 |
- var __extends = this.__extends || function (d, b) {
- for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
- function __() { this.constructor = d; }
- __.prototype = b.prototype;
- d.prototype = new __();
- };
- var wijmo;
- (function (wijmo) {
- (function (grid) {
- (function (sheet) {
- 'use strict';
- /**
- * Base class for Flexsheet undo/redo actions.
- */
- var _UndoableAction = (function () {
- /**
- * Initializes a new instance of a @see:_UndoableAction class.
- *
- * @param owener The @see: FlexSheet control that the _UndoableAction works for.
- */
- function _UndoableAction(owner) {
- this._owner = owner;
- this._sheetIndex = owner.selectedSheetIndex;
- }
- Object.defineProperty(_UndoableAction.prototype, "sheetIndex", {
- /**
- * Gets the index of the sheet that the undoable action wokrs for.
- */
- get: function () {
- return this._sheetIndex;
- },
- enumerable: true,
- configurable: true
- });
- /**
- * Excutes undo of the undoable action
- */
- _UndoableAction.prototype.undo = function () {
- throw 'This abstract method must be overrided.';
- };
- /**
- * Excutes redo of the undoable action
- */
- _UndoableAction.prototype.redo = function () {
- throw 'This abstract method must be overrided.';
- };
- /**
- * Saves the current flexsheet state.
- */
- _UndoableAction.prototype.saveNewState = function () {
- throw 'This abstract method must be overrided.';
- };
- return _UndoableAction;
- })();
- sheet._UndoableAction = _UndoableAction;
- /**
- * Defines the _EditAction class.
- *
- * It deals with the undo\redo for editing value of the flexsheet cells.
- */
- var _EditAction = (function (_super) {
- __extends(_EditAction, _super);
- /**
- * Initializes a new instance of a @see:_EditAction class.
- *
- * @param owener The @see: FlexSheet control that the _EditAction works for.
- */
- function _EditAction(owner) {
- _super.call(this, owner);
- this._selection = owner.selection;
- this._oldValue = owner.getCellData(this._selection.topRow, this._selection.leftCol, !!owner.columns[this._selection.leftCol].dataMap);
- this._oldValue = this._oldValue != undefined ? this._oldValue : '';
- }
- /**
- * Overrides the undo method of its base class @see:_UndoableAction.
- */
- _EditAction.prototype.undo = function () {
- this._owner.setCellData(this._selection.topRow, this._selection.leftCol, this._oldValue);
- this._owner.select(this._selection);
- this._owner.refresh(false);
- };
- /**
- * Overrides the redo method of its base class @see:_UndoableAction.
- */
- _EditAction.prototype.redo = function () {
- this._owner.setCellData(this._selection.topRow, this._selection.leftCol, this._newValue);
- this._owner.select(this._selection);
- this._owner.refresh(false);
- };
- /**
- * Overrides the saveNewState of its base class @see:_UndoableAction.
- */
- _EditAction.prototype.saveNewState = function () {
- var currentCol = this._owner.columns[this._selection.leftCol];
- if (!currentCol) {
- return false;
- }
- this._newValue = this._owner.getCellData(this._selection.topRow, this._selection.leftCol, !!this._owner.columns[this._selection.leftCol].dataMap);
- this._newValue = this._newValue != undefined ? this._newValue : '';
- return this._newValue !== this._oldValue;
- };
- return _EditAction;
- })(_UndoableAction);
- sheet._EditAction = _EditAction;
- /**
- * Defines the _ColumnResizeAction class.
- *
- * It deals with the undo\redo for resize the column of the flexsheet.
- */
- var _ColumnResizeAction = (function (_super) {
- __extends(_ColumnResizeAction, _super);
- /**
- * Initializes a new instance of a @see:_ColumnResizeAction class.
- *
- * @param owener The @see: FlexSheet control that the _ColumnResizeAction works for.
- * @param colIndex it indicates which column is resizing.
- */
- function _ColumnResizeAction(owner, colIndex) {
- _super.call(this, owner);
- this._colIndex = colIndex;
- this._oldColWidth = owner.columns[colIndex].width;
- }
- /**
- * Overrides the undo method of its base class @see:_UndoableAction.
- */
- _ColumnResizeAction.prototype.undo = function () {
- this._owner.columns[this._colIndex].width = this._oldColWidth;
- };
- /**
- * Overrides the redo method of its base class @see:_UndoableAction.
- */
- _ColumnResizeAction.prototype.redo = function () {
- this._owner.columns[this._colIndex].width = this._newColWidth;
- };
- /**
- * Overrides the saveNewState method of its base class @see:_UndoableAction.
- */
- _ColumnResizeAction.prototype.saveNewState = function () {
- this._newColWidth = this._owner.columns[this._colIndex].width;
- if (this._oldColWidth === this._newColWidth) {
- return false;
- }
- return true;
- };
- return _ColumnResizeAction;
- })(_UndoableAction);
- sheet._ColumnResizeAction = _ColumnResizeAction;
- /**
- * Defines the _RowResizeAction class.
- *
- * It deals with the undo\redo for resize the row of the flexsheet.
- */
- var _RowResizeAction = (function (_super) {
- __extends(_RowResizeAction, _super);
- /**
- * Initializes a new instance of a @see:_RowResizeAction class.
- *
- * @param owener The @see: FlexSheet control that the _RowResizeAction works for.
- * @param rowIndex it indicates which row is resizing.
- */
- function _RowResizeAction(owner, rowIndex) {
- _super.call(this, owner);
- this._rowIndex = rowIndex;
- this._oldRowHeight = owner.rows[rowIndex].height;
- }
- /**
- * Overrides the undo method of its base class @see:_UndoableAction.
- */
- _RowResizeAction.prototype.undo = function () {
- this._owner.rows[this._rowIndex].height = this._oldRowHeight;
- };
- /**
- * Overrides the redo method of its base class @see:_UndoableAction.
- */
- _RowResizeAction.prototype.redo = function () {
- this._owner.rows[this._rowIndex].height = this._newRowHeight;
- };
- /**
- * Overrides the saveNewState method of its base class @see:_UndoableAction.
- */
- _RowResizeAction.prototype.saveNewState = function () {
- this._newRowHeight = this._owner.rows[this._rowIndex].height;
- if (this._oldRowHeight === this._newRowHeight) {
- return false;
- }
- return true;
- };
- return _RowResizeAction;
- })(_UndoableAction);
- sheet._RowResizeAction = _RowResizeAction;
- /**
- * Defines the _InsertDeleteColumnAction class.
- *
- * It deals with the undo\redo for insert or delete column of the flexsheet.
- */
- var _InsertDeleteColumnAction = (function (_super) {
- __extends(_InsertDeleteColumnAction, _super);
- /**
- * Initializes a new instance of a @see:_InsertDeleteColumnAction class.
- *
- * @param owener The @see: FlexSheet control that the _InsertDeleteColumnAction works for.
- */
- function _InsertDeleteColumnAction(owner) {
- var colIndex, columns = [];
- _super.call(this, owner);
- for (colIndex = 0; colIndex < owner.columns.length; colIndex++) {
- columns.push(owner.columns[colIndex]);
- }
- this._oldValue = {
- columns: columns,
- sortList: owner.sortManager._committedList.slice(),
- styledCells: JSON.parse(JSON.stringify(owner.styledCells)),
- mergedCells: owner._cloneMergedCells()
- };
- }
- /**
- * Overrides the undo method of its base class @see:_UndoableAction.
- */
- _InsertDeleteColumnAction.prototype.undo = function () {
- var colIndex;
- this._owner.columns.clear();
- this._owner.styledCells = undefined;
- this._owner.mergedRange = undefined;
- for (colIndex = 0; colIndex < this._oldValue.columns.length; colIndex++) {
- this._owner.columns.push(this._oldValue.columns[colIndex]);
- }
- this._owner.styledCells = this._oldValue.styledCells;
- this._owner.mergedRange = this._oldValue.mergedCells;
- // Synch with current sheet.
- this._owner._copyTo(this._owner.selectedSheet);
- this._owner._copyFrom(this._owner.selectedSheet);
- // Synch the cell style for current sheet.
- this._owner.selectedSheet.dataGrid['wj_sheetInfo'].styledCells = this._owner.styledCells;
- // Synch the merged range for current sheet.
- this._owner.selectedSheet.dataGrid['wj_sheetInfo'].mergedRange = this._owner.mergedRange;
- this._owner.sortManager.sorts.sourceCollection = this._oldValue.sortList.slice();
- this._owner.sortManager.commitSort(false);
- this._owner.sortManager.refresh();
- this._owner.onColumnChanged();
- this._owner.refresh(true);
- };
- /**
- * Overrides the redo method of its base class @see:_UndoableAction.
- */
- _InsertDeleteColumnAction.prototype.redo = function () {
- var colIndex;
- this._owner.columns.clear();
- this._owner.styledCells = undefined;
- this._owner.mergedRange = undefined;
- for (colIndex = 0; colIndex < this._newValue.columns.length; colIndex++) {
- this._owner.columns.push(this._newValue.columns[colIndex]);
- }
- this._owner.styledCells = this._newValue.styledCells;
- this._owner.mergedRange = this._newValue.mergedCells;
- // Synch with current sheet.
- this._owner._copyTo(this._owner.selectedSheet);
- this._owner._copyFrom(this._owner.selectedSheet);
- // Synch the cell style for current sheet.
- this._owner.selectedSheet.dataGrid['wj_sheetInfo'].styledCells = this._owner.styledCells;
- // Synch the merged range for current sheet.
- this._owner.selectedSheet.dataGrid['wj_sheetInfo'].mergedRange = this._owner.mergedRange;
- this._owner.sortManager.sorts.sourceCollection = this._newValue.sortList.slice();
- this._owner.sortManager.commitSort(false);
- this._owner.sortManager.refresh();
- this._owner.onColumnChanged();
- this._owner.refresh(true);
- };
- /**
- * Overrides the saveNewState method of its base class @see:_UndoableAction.
- */
- _InsertDeleteColumnAction.prototype.saveNewState = function () {
- var colIndex, columns = [];
- for (colIndex = 0; colIndex < this._owner.columns.length; colIndex++) {
- columns.push(this._owner.columns[colIndex]);
- }
- this._newValue = {
- columns: columns,
- sortList: this._owner.sortManager._committedList.slice(),
- styledCells: JSON.parse(JSON.stringify(this._owner.styledCells)),
- mergedCells: this._owner._cloneMergedCells()
- };
- return true;
- };
- return _InsertDeleteColumnAction;
- })(_UndoableAction);
- sheet._InsertDeleteColumnAction = _InsertDeleteColumnAction;
- /**
- * Defines the _InsertDeleteRowAction class.
- *
- * It deals with the undo\redo for insert or delete row of the flexsheet.
- */
- var _InsertDeleteRowAction = (function (_super) {
- __extends(_InsertDeleteRowAction, _super);
- /**
- * Initializes a new instance of a @see:_InsertDeleteRowAction class.
- *
- * @param owener The @see: FlexSheet control that the _InsertDeleteRowAction works for.
- */
- function _InsertDeleteRowAction(owner) {
- var rowIndex, colIndex, rows = [], columns = [];
- _super.call(this, owner);
- for (rowIndex = 0; rowIndex < owner.rows.length; rowIndex++) {
- rows.push(owner.rows[rowIndex]);
- }
- for (colIndex = 0; colIndex < owner.columns.length; colIndex++) {
- columns.push(owner.columns[colIndex]);
- }
- this._oldValue = {
- rows: rows,
- columns: columns,
- itemsSource: owner.itemsSource ? owner.itemsSource.slice() : undefined,
- styledCells: JSON.parse(JSON.stringify(owner.styledCells)),
- mergedCells: owner._cloneMergedCells()
- };
- }
- /**
- * Overrides the undo method of its base class @see:_UndoableAction.
- */
- _InsertDeleteRowAction.prototype.undo = function () {
- var rowIndex, colIndex, processingRow, dataSourceBinding = !!this._oldValue.itemsSource;
- this._owner.finishEditing();
- this._owner.columns.clear();
- this._owner.rows.clear();
- this._owner.styledCells = undefined;
- this._owner.mergedRange = undefined;
- if (dataSourceBinding) {
- this._owner.autoGenerateColumns = false;
- this._owner.itemsSource = this._oldValue.itemsSource.slice();
- }
- for (rowIndex = 0; rowIndex < this._oldValue.rows.length; rowIndex++) {
- processingRow = this._oldValue.rows[rowIndex];
- if (dataSourceBinding) {
- if (!processingRow.dataItem && !(processingRow instanceof sheet.HeaderRow)) {
- this._owner.rows.splice(rowIndex, 0, processingRow);
- }
- } else {
- this._owner.rows.push(processingRow);
- }
- }
- for (colIndex = 0; colIndex < this._oldValue.columns.length; colIndex++) {
- this._owner.columns.push(this._oldValue.columns[colIndex]);
- }
- this._owner.styledCells = this._oldValue.styledCells;
- this._owner.mergedRange = this._oldValue.mergedCells;
- // Synch with current sheet.
- this._owner._copyTo(this._owner.selectedSheet);
- this._owner._copyFrom(this._owner.selectedSheet);
- // Synch the cell style for current sheet.
- this._owner.selectedSheet.dataGrid['wj_sheetInfo'].styledCells = this._owner.styledCells;
- // Synch the merged range for current sheet.
- this._owner.selectedSheet.dataGrid['wj_sheetInfo'].mergedRange = this._owner.mergedRange;
- this._owner.refresh(true);
- };
- /**
- * Overrides the redo method of its base class @see:_UndoableAction.
- */
- _InsertDeleteRowAction.prototype.redo = function () {
- var rowIndex, colIndex, processingRow, dataSourceBinding = !!this._newValue.itemsSource;
- this._owner.finishEditing();
- this._owner.columns.clear();
- this._owner.rows.clear();
- this._owner.styledCells = undefined;
- this._owner.mergedRange = undefined;
- if (dataSourceBinding) {
- this._owner.autoGenerateColumns = false;
- this._owner.itemsSource = this._newValue.itemsSource.slice();
- }
- for (rowIndex = 0; rowIndex < this._newValue.rows.length; rowIndex++) {
- processingRow = this._newValue.rows[rowIndex];
- if (dataSourceBinding) {
- if (!processingRow.dataItem && !(processingRow instanceof sheet.HeaderRow)) {
- this._owner.rows.splice(rowIndex, 0, processingRow);
- }
- } else {
- this._owner.rows.push(processingRow);
- }
- }
- for (colIndex = 0; colIndex < this._newValue.columns.length; colIndex++) {
- this._owner.columns.push(this._newValue.columns[colIndex]);
- }
- this._owner.styledCells = this._newValue.styledCells;
- this._owner.mergedRange = this._newValue.mergedCells;
- // Synch with current sheet.
- this._owner._copyTo(this._owner.selectedSheet);
- this._owner._copyFrom(this._owner.selectedSheet);
- // Synch the cell style for current sheet.
- this._owner.selectedSheet.dataGrid['wj_sheetInfo'].styledCells = this._owner.styledCells;
- // Synch the merged range for current sheet.
- this._owner.selectedSheet.dataGrid['wj_sheetInfo'].mergedRange = this._owner.mergedRange;
- this._owner.refresh(true);
- };
- /**
- * Overrides the saveNewState method of its base class @see:_UndoableAction.
- */
- _InsertDeleteRowAction.prototype.saveNewState = function () {
- var rowIndex, colIndex, rows = [], columns = [];
- for (rowIndex = 0; rowIndex < this._owner.rows.length; rowIndex++) {
- rows.push(this._owner.rows[rowIndex]);
- }
- for (colIndex = 0; colIndex < this._owner.columns.length; colIndex++) {
- columns.push(this._owner.columns[colIndex]);
- }
- this._newValue = {
- rows: rows,
- columns: columns,
- itemsSource: this._owner.itemsSource ? this._owner.itemsSource.slice() : undefined,
- styledCells: JSON.parse(JSON.stringify(this._owner.styledCells)),
- mergedCells: this._owner._cloneMergedCells()
- };
- return true;
- };
- return _InsertDeleteRowAction;
- })(_UndoableAction);
- sheet._InsertDeleteRowAction = _InsertDeleteRowAction;
- /**
- * Defines the _CellStyleAction class.
- *
- * It deals with the undo\redo for applying style for the cells of the flexsheet.
- */
- var _CellStyleAction = (function (_super) {
- __extends(_CellStyleAction, _super);
- /**
- * Initializes a new instance of a @see:_CellStyleAction class.
- *
- * @param owener The @see: FlexSheet control that the _CellStyleAction works for.
- * @param styledCells Current styled cells of the @see: FlexSheet control.
- */
- function _CellStyleAction(owner, styledCells) {
- _super.call(this, owner);
- this._oldStyledCells = styledCells ? JSON.parse(JSON.stringify(styledCells)) : JSON.parse(JSON.stringify(owner.styledCells));
- }
- /**
- * Overrides the undo method of its base class @see:_UndoableAction.
- */
- _CellStyleAction.prototype.undo = function () {
- this._owner.styledCells = JSON.parse(JSON.stringify(this._oldStyledCells));
- // Synch the cell style for current sheet.
- this._owner.selectedSheet.styledCells = this._owner.styledCells;
- this._owner.selectedSheet.dataGrid['wj_sheetInfo'].styledCells = this._owner.styledCells;
- this._owner.refresh(true);
- };
- /**
- * Overrides the redo method of its base class @see:_UndoableAction.
- */
- _CellStyleAction.prototype.redo = function () {
- this._owner.styledCells = JSON.parse(JSON.stringify(this._newStyledCells));
- // Synch the cell style for current sheet.
- this._owner.selectedSheet.styledCells = this._owner.styledCells;
- this._owner.selectedSheet.dataGrid['wj_sheetInfo'].styledCells = this._owner.styledCells;
- this._owner.refresh(true);
- };
- /**
- * Overrides the saveNewState method of its base class @see:_UndoableAction.
- */
- _CellStyleAction.prototype.saveNewState = function () {
- this._newStyledCells = JSON.parse(JSON.stringify(this._owner.styledCells));
- return true;
- };
- return _CellStyleAction;
- })(_UndoableAction);
- sheet._CellStyleAction = _CellStyleAction;
- /**
- * Defines the _CellMergeAction class.
- *
- * It deals with the undo\redo for merging the cells of the flexsheet.
- */
- var _CellMergeAction = (function (_super) {
- __extends(_CellMergeAction, _super);
- /**
- * Initializes a new instance of a @see:_CellMergeAction class.
- *
- * @param owener The @see: FlexSheet control that the _CellMergeAction works for.
- */
- function _CellMergeAction(owner) {
- _super.call(this, owner);
- this._oldMergedCells = owner._cloneMergedCells();
- }
- /**
- * Overrides the undo method of its base class @see:_UndoableAction.
- */
- _CellMergeAction.prototype.undo = function () {
- this._owner.mergedRange = this._oldMergedCells;
- // Synch the merged range for current sheet.
- this._owner.selectedSheet.mergedRange = this._owner.mergedRange;
- this._owner.selectedSheet.dataGrid['wj_sheetInfo'].mergedRange = this._owner.mergedRange;
- this._owner.refresh(true);
- };
- /**
- * Overrides the redo method of its base class @see:_UndoableAction.
- */
- _CellMergeAction.prototype.redo = function () {
- this._owner.mergedRange = this._newMergedCells;
- // Synch the merged range for current sheet.
- this._owner.selectedSheet.mergedRange = this._owner.mergedRange;
- this._owner.selectedSheet.dataGrid['wj_sheetInfo'].mergedRange = this._owner.mergedRange;
- this._owner.refresh(true);
- };
- /**
- * Overrides the saveNewState method of its base class @see:_UndoableAction.
- */
- _CellMergeAction.prototype.saveNewState = function () {
- this._newMergedCells = this._owner._cloneMergedCells();
- return true;
- };
- return _CellMergeAction;
- })(_UndoableAction);
- sheet._CellMergeAction = _CellMergeAction;
- /**
- * Defines the _SortColumnAction class.
- *
- * It deals with the undo\redo for sort columns of the flexsheet.
- */
- var _SortColumnAction = (function (_super) {
- __extends(_SortColumnAction, _super);
- /**
- * Initializes a new instance of a @see:_CellMergeAction class.
- *
- * @param owener The @see: FlexSheet control that the _CellMergeAction works for.
- */
- function _SortColumnAction(owner) {
- var rowIndex, colIndex, columns = [], rows = [];
- _super.call(this, owner);
- if (!owner.itemsSource) {
- for (rowIndex = 0; rowIndex < owner.rows.length; rowIndex++) {
- rows.push(owner.rows[rowIndex]);
- }
- for (colIndex = 0; colIndex < owner.columns.length; colIndex++) {
- columns.push(owner.columns[colIndex]);
- }
- }
- this._oldValue = {
- sortList: owner.sortManager._committedList.slice(),
- rows: rows,
- columns: columns
- };
- }
- /**
- * Overrides the undo method of its base class @see:_UndoableAction.
- */
- _SortColumnAction.prototype.undo = function () {
- var rowIndex, colIndex;
- this._owner.sortManager.sorts.sourceCollection = this._oldValue.sortList.slice();
- this._owner.sortManager.commitSort(false);
- this._owner.sortManager.refresh();
- if (!this._owner.itemsSource) {
- this._owner.rows.clear();
- this._owner.columns.clear();
- this._owner.selectedSheet.dataGrid.rows.clear();
- this._owner.selectedSheet.dataGrid.columns.clear();
- for (rowIndex = 0; rowIndex < this._oldValue.rows.length; rowIndex++) {
- this._owner.rows.push(this._oldValue.rows[rowIndex]);
- // Synch the rows of the datagrid for current sheet.
- this._owner.selectedSheet.dataGrid.rows.push(this._oldValue.rows[rowIndex]);
- }
- for (colIndex = 0; colIndex < this._oldValue.columns.length; colIndex++) {
- this._owner.columns.push(this._oldValue.columns[colIndex]);
- // Synch the columns of the datagrid for current sheet.
- this._owner.selectedSheet.dataGrid.columns.push(this._oldValue.columns[colIndex]);
- }
- }
- };
- /**
- * Overrides the redo method of its base class @see:_UndoableAction.
- */
- _SortColumnAction.prototype.redo = function () {
- var rowIndex, colIndex;
- this._owner.sortManager.sorts.sourceCollection = this._newValue.sortList.slice();
- this._owner.sortManager.commitSort(false);
- this._owner.sortManager.refresh();
- if (!this._owner.itemsSource) {
- this._owner.rows.clear();
- this._owner.columns.clear();
- this._owner.selectedSheet.dataGrid.rows.clear();
- this._owner.selectedSheet.dataGrid.columns.clear();
- for (rowIndex = 0; rowIndex < this._newValue.rows.length; rowIndex++) {
- this._owner.rows.push(this._newValue.rows[rowIndex]);
- // Synch the rows of the datagrid for current sheet.
- this._owner.selectedSheet.dataGrid.rows.push(this._newValue.rows[rowIndex]);
- }
- for (colIndex = 0; colIndex < this._newValue.columns.length; colIndex++) {
- this._owner.columns.push(this._newValue.columns[colIndex]);
- // Synch the columns of the datagrid for current sheet.
- this._owner.selectedSheet.dataGrid.columns.push(this._newValue.columns[colIndex]);
- }
- }
- };
- /**
- * Overrides the saveNewState method of its base class @see:_UndoableAction.
- */
- _SortColumnAction.prototype.saveNewState = function () {
- var rowIndex, colIndex, columns = [], rows = [];
- if (!this._owner.itemsSource) {
- for (rowIndex = 0; rowIndex < this._owner.rows.length; rowIndex++) {
- rows.push(this._owner.rows[rowIndex]);
- }
- for (colIndex = 0; colIndex < this._owner.columns.length; colIndex++) {
- columns.push(this._owner.columns[colIndex]);
- }
- }
- this._newValue = {
- sortList: this._owner.sortManager._committedList.slice(),
- rows: rows,
- columns: columns
- };
- return true;
- };
- return _SortColumnAction;
- })(_UndoableAction);
- sheet._SortColumnAction = _SortColumnAction;
- })(grid.sheet || (grid.sheet = {}));
- var sheet = grid.sheet;
- })(wijmo.grid || (wijmo.grid = {}));
- var grid = wijmo.grid;
- })(wijmo || (wijmo = {}));
- //# sourceMappingURL=_UndoableAction.js.map
|