Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
cherniavskii committed Sep 20, 2023
1 parent ec8c56a commit 3767d7a
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 11 deletions.
2 changes: 1 addition & 1 deletion docs/pages/x/api/data-grid/grid-csv-export-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import { GridCsvExportOptions } from '@mui/x-data-grid';
| <span class="prop-name optional">delimiter<sup><abbr title="optional">?</abbr></sup></span> | <span class="prop-type">string</span> | <span class="prop-default">','</span> | The character used to separate fields. |
| <span class="prop-name optional">fields<sup><abbr title="optional">?</abbr></sup></span> | <span class="prop-type">string[]</span> | | The columns exported.<br />This should only be used if you want to restrict the columns exports. |
| <span class="prop-name optional">fileName<sup><abbr title="optional">?</abbr></sup></span> | <span class="prop-type">string</span> | <span class="prop-default">`document.title`</span> | The string used as the file name. |
| <span class="prop-name optional">getRowsToExport<sup><abbr title="optional">?</abbr></sup></span> | <span class="prop-type">(params: GridCsvGetRowsToExportParams) =&gt; GridRowId[]</span> | | Function that returns the id of the rows to export on the order they should be exported. |
| <span class="prop-name optional">getRowsToExport<sup><abbr title="optional">?</abbr></sup></span> | <span class="prop-type">(params: GridCsvGetRowsToExportParams) =&gt; GridRowId[]</span> | | Function that returns the list of row ids to export on the order they should be exported. |
| <span class="prop-name optional">includeColumnGroupsHeaders<sup><abbr title="optional">?</abbr></sup></span> | <span class="prop-type">boolean</span> | <span class="prop-default">true</span> | If `true`, the CSV will include the column groups. |
| <span class="prop-name optional">includeHeaders<sup><abbr title="optional">?</abbr></sup></span> | <span class="prop-type">boolean</span> | <span class="prop-default">true</span> | If `true`, the CSV will include the column headers and column groups.<br />Use `includeColumnGroupsHeaders` to control whether the column groups are included. |
| <span class="prop-name optional">utf8WithBom<sup><abbr title="optional">?</abbr></sup></span> | <span class="prop-type">boolean</span> | <span class="prop-default">false</span> | If `true`, the UTF-8 Byte Order Mark (BOM) prefixes the exported file.<br />This can allow Excel to automatically detect file encoding as UTF-8. |
2 changes: 1 addition & 1 deletion docs/pages/x/api/data-grid/grid-excel-export-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import { GridExcelExportOptions } from '@mui/x-data-grid-premium';
| <span class="prop-name optional">exceljsPreProcess<sup><abbr title="optional">?</abbr></sup> [<span class="plan-premium" title="Premium plan"></span>](/x/introduction/licensing/#premium-plan)</span> | <span class="prop-type">(processInput: GridExceljsProcessInput) =&gt; Promise&lt;void&gt;</span> | | Method called before adding the rows to the workbook.<br />Not supported when `worker` is set.<br />To use with web workers, use the option in `setupExcelExportWebWorker`. |
| <span class="prop-name optional">fields<sup><abbr title="optional">?</abbr></sup> [<span class="plan-premium" title="Premium plan"></span>](/x/introduction/licensing/#premium-plan)</span> | <span class="prop-type">string[]</span> | | The columns exported.<br />This should only be used if you want to restrict the columns exports. |
| <span class="prop-name optional">fileName<sup><abbr title="optional">?</abbr></sup> [<span class="plan-premium" title="Premium plan"></span>](/x/introduction/licensing/#premium-plan)</span> | <span class="prop-type">string</span> | <span class="prop-default">`document.title`</span> | The string used as the file name. |
| <span class="prop-name optional">getRowsToExport<sup><abbr title="optional">?</abbr></sup> [<span class="plan-premium" title="Premium plan"></span>](/x/introduction/licensing/#premium-plan)</span> | <span class="prop-type">(params: GridGetRowsToExportParams&lt;Api&gt;) =&gt; GridRowId[]</span> | | Function that returns the id of the rows to export on the order they should be exported. |
| <span class="prop-name optional">getRowsToExport<sup><abbr title="optional">?</abbr></sup> [<span class="plan-premium" title="Premium plan"></span>](/x/introduction/licensing/#premium-plan)</span> | <span class="prop-type">(params: GridGetRowsToExportParams&lt;Api&gt;) =&gt; GridRowId[]</span> | | Function that returns the list of row ids to export on the order they should be exported. |
| <span class="prop-name optional">includeColumnGroupsHeaders<sup><abbr title="optional">?</abbr></sup> [<span class="plan-premium" title="Premium plan"></span>](/x/introduction/licensing/#premium-plan)</span> | <span class="prop-type">boolean</span> | <span class="prop-default">true</span> | If `true`, the headers of the column groups will be added into the file. |
| <span class="prop-name optional">includeHeaders<sup><abbr title="optional">?</abbr></sup> [<span class="plan-premium" title="Premium plan"></span>](/x/introduction/licensing/#premium-plan)</span> | <span class="prop-type">boolean</span> | <span class="prop-default">true</span> | If `true`, the first row of the file will include the headers of the grid. |
| <span class="prop-name optional">valueOptionsSheetName<sup><abbr title="optional">?</abbr></sup> [<span class="plan-premium" title="Premium plan"></span>](/x/introduction/licensing/#premium-plan)</span> | <span class="prop-type">string</span> | | Name given to the worksheet containing the columns valueOptions.<br />valueOptions are added to this worksheet if they are provided as an array. |
Expand Down
2 changes: 1 addition & 1 deletion docs/pages/x/api/data-grid/grid-print-export-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import { GridPrintExportOptions } from '@mui/x-data-grid';
| <span class="prop-name optional">copyStyles<sup><abbr title="optional">?</abbr></sup></span> | <span class="prop-type">boolean</span> | <span class="prop-default">true</span> | If `false`, all &lt;style&gt; and &lt;link type="stylesheet" /&gt; tags from the &lt;head&gt; will not be copied<br />to the print window. |
| <span class="prop-name optional">fields<sup><abbr title="optional">?</abbr></sup></span> | <span class="prop-type">string[]</span> | | The columns exported.<br />This should only be used if you want to restrict the columns exports. |
| <span class="prop-name optional">fileName<sup><abbr title="optional">?</abbr></sup></span> | <span class="prop-type">string</span> | <span class="prop-default">The title of the page.</span> | The value to be used as the print window title. |
| <span class="prop-name optional">getRowsToExport<sup><abbr title="optional">?</abbr></sup></span> | <span class="prop-type">(params: GridPrintGetRowsToExportParams) =&gt; GridRowId[]</span> | | Function that returns the id of the rows to export in the order they should be exported. |
| <span class="prop-name optional">getRowsToExport<sup><abbr title="optional">?</abbr></sup></span> | <span class="prop-type">(params: GridPrintGetRowsToExportParams) =&gt; GridRowId[]</span> | | Function that returns the list of row ids to export in the order they should be exported. |
| <span class="prop-name optional">hideFooter<sup><abbr title="optional">?</abbr></sup></span> | <span class="prop-type">boolean</span> | <span class="prop-default">false</span> | If `true`, the footer is removed for when printing. |
| <span class="prop-name optional">hideToolbar<sup><abbr title="optional">?</abbr></sup></span> | <span class="prop-type">boolean</span> | <span class="prop-default">false</span> | If `true`, the toolbar is removed for when printing. |
| <span class="prop-name optional">includeCheckboxes<sup><abbr title="optional">?</abbr></sup></span> | <span class="prop-type">boolean</span> | <span class="prop-default">false</span> | If `true`, the selection checkboxes will be included when printing. |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,7 @@ export const useGridPrintExport = (
getRowsToExport: (params: GridPrintGetRowsToExportParams<GridApiCommunity>) => GridRowId[],
) => {
const rowsToExportIds = getRowsToExport({ apiRef });

const newRows = rowsToExportIds.map((id) => apiRef.current.getRow(id));

apiRef.current.setRows(newRows);
},
[apiRef],
Expand Down
12 changes: 6 additions & 6 deletions packages/grid/x-data-grid/src/models/gridExport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ export interface GridFileExportOptions<Api extends GridApiCommon = GridApiCommun
*/
includeHeaders?: boolean;
/**
* Function that returns the id of the rows to export on the order they should be exported.
* Function that returns the list of row ids to export on the order they should be exported.
* @param {GridGetRowsToExportParams} params With all properties from [[GridGetRowsToExportParams]].
* @returns {GridRowId[]} The id of the rows to export.
* @returns {GridRowId[]} The list of row ids to export.
*/
getRowsToExport?: (params: GridGetRowsToExportParams<Api>) => GridRowId[];
}
Expand Down Expand Up @@ -90,9 +90,9 @@ export interface GridCsvExportOptions extends GridFileExportOptions {
*/
includeColumnGroupsHeaders?: boolean;
/**
* Function that returns the id of the rows to export on the order they should be exported.
* Function that returns the list of row ids to export on the order they should be exported.
* @param {GridCsvGetRowsToExportParams} params With all properties from [[GridCsvGetRowsToExportParams]].
* @returns {GridRowId[]} The id of the rows to export.
* @returns {GridRowId[]} The list of row ids to export.
*/
getRowsToExport?: (params: GridCsvGetRowsToExportParams) => GridRowId[];
}
Expand Down Expand Up @@ -138,9 +138,9 @@ export interface GridPrintExportOptions extends GridExportOptions {
*/
pageStyle?: string | Function;
/**
* Function that returns the id of the rows to export in the order they should be exported.
* Function that returns the list of row ids to export in the order they should be exported.
* @param {GridPrintGetRowsToExportParams} params With all properties from [[GridPrintGetRowsToExportParams]].
* @returns {GridRowId[]} The id of the rows to export.
* @returns {GridRowId[]} The list of row ids to export.
*/
getRowsToExport?: (params: GridPrintGetRowsToExportParams) => GridRowId[];
}
Expand Down

0 comments on commit 3767d7a

Please sign in to comment.