Closed Yusufzai closed 2 years ago
Hi
const dataExported = editor.export();
console.log(dataExported);
I understand that what you want is this.
Dear Jero
Thanks for your reply :)
I think I am not clear to you.
I already have two save buttons -
So I want the Second Button (i.e. Save All) functionality as I have already implemented First Button (i.e. Save) functionality.
With editor.export()
you can get all the data that is on the canvas. Or filter the information you want.
Dear Jero
Thanks for your reply :)
But, I have just completed my code and it works perfectly
On click of the second button i.e. Save All Button
var GlobalSave = document.querySelectorAll('.global-save-fields');
for (let index = 0; index < GlobalSave.length; index++) {
GlobalSave[index].addEventListener('click', function() {
DataLength = editor.drawflow.drawflow.Home.data;
Object.keys(DataLength).map(function(k){
dataValue_k = DataLength[k];
dataAgent_k = k;
getDataName = dataValue_k.name;
switch (getDataName) {
case 'widget-name':
// My Code to update data
break;
}
})
})
}
Perfect! 👍
Currently I am saving data for each widget with a save button which has widget ID.
What I want?
I have created a button with the name Save All.
When pressed it will save the all the data.