Skip to content

Commit 2824f5c

Browse files
committed
CSV downloads added UTF-8 support for french accents and delimiter configuration paramter
1 parent d3c7884 commit 2824f5c

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ Configuration keys supported only by the data-table plugin:
2121
| :-- | :-- | :-- | :-- |
2222
| `entityType` | "edge" \| "node" (**required**) | Whether to display nodes or edges in the table. | `"node"` |
2323
| `itemType` | string (**required**) | Name of the node category or edge type to display in the table. | `"Company"` |
24+
| `delimiter` | string (**optional**) | The delimiter used for csv files downloads. By default "," is used | `";"` |
2425
| `properties` | string\[] (**optional**) | Property names to include in the table. Defaults to all the properties of `itemType`. | `["name", "address", "vat_number"]` |
2526

2627
Configuration example for 1 data-table instance accesible via `/plugins/table`:

public/js/main.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,11 @@ function showModal() {
525525
function addButtons() {
526526
// EXPORT TO CSV BUTTON
527527
document.getElementById('button-export').addEventListener('click', () => {
528-
table.download('csv', 'data.csv');
528+
delimiterCharacter = ",";
529+
if (pluginConfiguration.delimiter){
530+
delimiterCharacter = pluginConfiguration.delimiter;
531+
}
532+
table.download('csv', 'data.csv', {delimiter:delimiterCharacter, bom:true});
529533
});
530534

531535
// OPEN EDIT COLUMN MODAL

0 commit comments

Comments
 (0)