mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) Adding hide for multiple columns
Summary: New column menu option to hide multiple columns. Test Plan: new test Reviewers: georgegevoian Reviewed By: georgegevoian Differential Revision: https://phab.getgrist.com/D3581
This commit is contained in:
@@ -305,7 +305,7 @@ GridView.gridCommands = {
|
||||
insertFieldBefore: function() { this.insertColumn(this.cursor.fieldIndex()); },
|
||||
insertFieldAfter: function() { this.insertColumn(this.cursor.fieldIndex() + 1); },
|
||||
renameField: function() { this.currentEditingColumnIndex(this.cursor.fieldIndex()); },
|
||||
hideField: function() { this.hideField(this.cursor.fieldIndex()); },
|
||||
hideFields: function() { this.hideFields(this.getSelection()); },
|
||||
deleteFields: function() { this.deleteColumns(this.getSelection()); },
|
||||
clearValues: function() { this.clearValues(this.getSelection()); },
|
||||
clearColumns: function() { this._clearColumns(this.getSelection()); },
|
||||
@@ -723,10 +723,10 @@ GridView.prototype.deleteColumns = function(selection) {
|
||||
}
|
||||
};
|
||||
|
||||
GridView.prototype.hideField = function(index) {
|
||||
var field = this.viewSection.viewFields().at(index);
|
||||
var action = ['RemoveRecord', field.id()];
|
||||
return this.gristDoc.docModel.viewFields.sendTableAction(action);
|
||||
GridView.prototype.hideFields = function(selection) {
|
||||
var actions = selection.fields.map(field => ['RemoveRecord', field.id()]);
|
||||
return this.gristDoc.docModel.viewFields.sendTableActions(actions, `Hide columns ${actions.map(a => a[1]).join(', ')} ` +
|
||||
`from ${this.tableModel.tableData.tableId}.`);
|
||||
};
|
||||
|
||||
GridView.prototype.moveColumns = function(oldIndices, newIndex) {
|
||||
|
||||
@@ -348,9 +348,9 @@ exports.groups = [{
|
||||
keys: ['Ctrl+m'],
|
||||
desc: 'Rename the currently selected column'
|
||||
}, {
|
||||
name: 'hideField',
|
||||
name: 'hideFields',
|
||||
keys: ['Alt+Shift+-'],
|
||||
desc: 'Hide the currently selected column'
|
||||
desc: 'Hide currently selected columns'
|
||||
}, {
|
||||
name: 'toggleFreeze',
|
||||
keys: [],
|
||||
|
||||
Reference in New Issue
Block a user