Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ipysheet/sheet.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ class Sheet(widgets.DOMWidget):
column_width = Union([CInt(), List(CInt())], default_value=None, allow_none=True).tag(sync=True)
column_resizing = Bool(True).tag(sync=True)
row_resizing = Bool(True).tag(sync=True)
column_sorting = Bool(True).tag(sync=True)
search_token = Unicode('').tag(sync=True)

layout = LayoutTraitType(kw=dict(height='auto', width='auto')).tag(sync=True, **widgets.widget_serialization)
Expand Down
10 changes: 9 additions & 1 deletion js/src/sheet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ let SheetModel = widgets.DOMWidgetModel.extend({
column_width: null,
column_resizing: true,
row_resizing: true,
column_sorting: true,
search_token: ''
});
},
Expand Down Expand Up @@ -285,6 +286,7 @@ let SheetView = widgets.DOMWidgetView.extend({
this.model.on('change:column_headers change:row_headers', this._update_hot_settings, this);
this.model.on('change:stretch_headers change:column_width', this._update_hot_settings, this);
this.model.on('change:column_resizing change:row_resizing', this._update_hot_settings, this);
this.model.on('change:column_sorting', this._update_hot_settings, this);
this.model.on('change:search_token', this._search, this);
this._search()
});
Expand Down Expand Up @@ -403,6 +405,12 @@ let SheetView = widgets.DOMWidgetView.extend({
rowHeaders: this.model.get('row_headers'),
stretchH: this.model.get('stretch_headers'),
colWidths: this.model.get('column_width') || undefined,
columnSorting: {
sortEmptyCells: false,
indicator: this.model.get('column_sorting'),
headerAction: this.model.get('column_sorting'),
compareFunctionFactory: this._compareFunctionFactory
},
manualColumnResize: this.model.get('column_resizing'),
manualRowResize: this.model.get('row_resizing')
};
Expand Down Expand Up @@ -520,4 +528,4 @@ export {
SheetView,
CellRangeModel,
RendererModel
};
};