Hi,
We are exporting on a smart-grid with the help of smart-drop-down-list and every time there is a change the value is picked up and the data is exported on a condition.
The issue that really occurs is that the event is fired twice and produces two exports for a single event (change of a dropdown value in our case).
Any idea how this can be resolved?
Code:
const gridExport = document.querySelector(‘smart-grid’);
let dropdown = document.createElement(‘smart-drop-down-list’);
dropdown.id = “dropdownlist”;
const dropdownExport = document.querySelector(‘#dropdownlist’);
dropdownExport.addEventListener(‘change’, function(event) {
const detail = event.detail;
if (detail.value === “Download as spreadsheet”){
gridExport.exportData(‘xlsx’);
} else if (detail.value === “Download as CSV file”){
gridExport.exportData(‘csv’);
}
else {
};
});