mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) add new filter bar
Summary: - add new filterBar option to views section - add toggle to the section menu - add filter bar - shows Save/Revert btn when unsaved change - shows all filered fields witch edit and delete buttons Test Plan: Add new FilterBar nbrowser test Reviewers: paulfitz, dsagal Reviewed By: dsagal Differential Revision: https://phab.getgrist.com/D2769
This commit is contained in:
@@ -88,6 +88,7 @@ export interface ViewSectionRec extends IRowModel<"_grist_Views_section"> {
|
||||
|
||||
isSorted: ko.Computed<boolean>;
|
||||
disableDragRows: ko.Computed<boolean>;
|
||||
activeFilterBar: modelUtil.CustomComputed<boolean>;
|
||||
|
||||
// Save all filters of fields in the section.
|
||||
saveFilters(): Promise<void>;
|
||||
@@ -131,6 +132,7 @@ export function createViewSectionRec(this: ViewSectionRec, docModel: DocModel):
|
||||
horizontalGridlines: true,
|
||||
zebraStripes: false,
|
||||
customView: '',
|
||||
filterBar: false,
|
||||
};
|
||||
this.optionsObj = modelUtil.jsonObservable(this.options,
|
||||
(obj: any) => defaults(obj || {}, defaultOptions));
|
||||
@@ -272,4 +274,6 @@ export function createViewSectionRec(this: ViewSectionRec, docModel: DocModel):
|
||||
|
||||
this.isSorted = ko.pureComputed(() => this.activeSortSpec().length > 0);
|
||||
this.disableDragRows = ko.pureComputed(() => this.isSorted() || !this.table().supportsManualSort());
|
||||
|
||||
this.activeFilterBar = modelUtil.customValue(this.optionsObj.prop('filterBar'));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user