@@ -3,7 +3,6 @@ import { Message, IMessageHandler, MessageLoop } from "@lumino/messaging";
33import { BasicMouseHandler , BasicKeyHandler , TextRenderer , DataModel , BasicSelectionModel , CellRenderer , RendererMap } from "@lumino/datagrid" ;
44import { CommandRegistry } from "@lumino/commands" ;
55import { toArray } from "@lumino/algorithm" ;
6- import { JSONExt } from "@lumino/coreutils" ;
76import { Signal , ISignal } from '@lumino/signaling' ;
87import { DataGrid } from "./core/datagrid" ;
98import { HeaderRenderer } from "./core/headerRenderer" ;
@@ -188,11 +187,8 @@ class FeatherGrid extends Widget {
188187 if ( msg . type === 'column-resize-request' && mouseHandler . mouseIsDown ) {
189188 const resizeMsg = msg as unknown as FeatherGridColumnResizeMessage ;
190189 let columnName : string = this . dataModel . columnIndexToName ( resizeMsg . index , resizeMsg . region ) ;
191- const dict = JSONExt . deepCopy ( this . _columnWidths ) ;
192-
193- dict [ columnName ] = resizeMsg . size ;
194- this . _columnWidths = dict ;
195- //this.model.save_changes(); // TODO
190+ this . _columnWidths [ columnName ] = resizeMsg . size ;
191+ this . _columnsResized . emit ( ) ;
196192 return true ;
197193 }
198194 }
@@ -644,6 +640,13 @@ class FeatherGrid extends Widget {
644640 return this . _cellClicked ;
645641 }
646642
643+ /**
644+ * A signal emitted when a grid column is resized.
645+ */
646+ get columnsResized ( ) : ISignal < this, void > {
647+ return this . _columnsResized ;
648+ }
649+
647650 set isLightTheme ( value : boolean ) {
648651 this . _isLightTheme = value ;
649652
@@ -846,6 +849,7 @@ class FeatherGrid extends Widget {
846849 private _defaultRenderer : CellRenderer ;
847850 private _defaultRendererSet : boolean = false ;
848851 private _cellClicked = new Signal < this, FeatherGrid . ICellClickedEvent > ( this ) ;
852+ private _columnsResized = new Signal < this, void > ( this ) ;
849853 private _isLightTheme : boolean = true ;
850854}
851855
0 commit comments