mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) Download as CSV button on sections
Summary: Adding "Download as CSV" button that exports filtred section data to csv Test Plan: Browser tests Reviewers: paulfitz, dsagal Reviewed By: paulfitz Differential Revision: https://phab.getgrist.com/D2830
This commit is contained in:
@@ -576,13 +576,19 @@ export class GristDoc extends DisposableWithEvents {
|
||||
}
|
||||
|
||||
public getCsvLink() {
|
||||
return this.docComm.docUrl('gen_csv') + '?' + encodeQueryParams({
|
||||
const filters = this.viewModel.activeSection.peek().filteredFields.get().map(field=> ({
|
||||
colRef : field.colRef.peek(),
|
||||
filter : field.activeFilter.peek()
|
||||
}));
|
||||
const params = {
|
||||
...this.docComm.getUrlParams(),
|
||||
title: this.docPageModel.currentDocTitle.get(),
|
||||
viewSection: this.viewModel.activeSectionId(),
|
||||
tableId: this.viewModel.activeSection().table().tableId(),
|
||||
activeSortSpec: JSON.stringify(this.viewModel.activeSection().activeSortSpec())
|
||||
});
|
||||
activeSortSpec: JSON.stringify(this.viewModel.activeSection().activeSortSpec()),
|
||||
filters : JSON.stringify(filters),
|
||||
};
|
||||
return this.docComm.docUrl('gen_csv') + '?' + encodeQueryParams(params);
|
||||
}
|
||||
|
||||
public hasGranularAccessRules(): boolean {
|
||||
|
||||
Reference in New Issue
Block a user