exportPlugin.downloadFile is not a function

Tags: #<Tag:0x00007efc64da8d58>

I’m using Handsontable with Vue.js 2.0.

When I try to export data as a CSV file I get this error in the console. exportPlugin.downloadFile is not a function.

Code.
html:


<q-btn flat icon=“download” label=“download CSV” @click=“downloadCSV” />

script:
import Handsontable from ‘handsontable’;
methods: {
downloadCSV(){
const exportPlugin = Handsontable.plugins.getPlugin(“exportFile”)
exportPlugin.downloadFile(‘csv’)
}
}

I’m new in this field, Sorry in advance if it’s a simple error. I will really appreciate your help.
Thank you in advance.

Hi @zamidmm.

Here you can find working demo for your issue: https://jsfiddle.net/aszymanski/3jb0Lcod/

What has changed is the Handsontable instance reference, you can see in the example how it should be done in order to get things work. I hope that will be helpful.

@adrian.szymanski

Thank you so much :heart:. It worked like a charm.