Hi, I'm having an issue that when I call save(), after the user edited a cell on drillthrough or even on flat mode, the data that is send on the request is not updated according to the edition made by the user. Note that im using server destination.
save() {
this.pivotTable.flexmonster.save({
filename: 'report.json',
destination: 'server',
url: `myURL`,
serverContentType: 'application/json',
});
}
Hello, Jedison!
Thank you for contacting us.
Kindly note that Flexmonster is designed as a data visualization tool first. Therefore, we don't change the underlying data in the dataset by ourselves, even with editing enabled.
We have added the datachanged event to track when the data was changed in Flexmonster. Then you can apply your custom data validation and the necessary changes to your data in the event handler. After the data is updated in the datasource, you can refresh the data on the grid using the updateData API call if necessary.
Here is the JSFiddle to illustrate the idea: https://jsfiddle.net/flexmonster/3sryh5wm/.
We also wanted to mention our exporting feature, which always saves the current data visualization on the grid, including edited data.
So, in case only the data changes need to be saved, you may find our export to the server feature useful: https://www.flexmonster.com/doc/export-report/#destinationtype-csv.
Hope you will find our answer helpful.
Kind regards,
Solomiia
Thanks Solomiia, your answer was really helpfull and we were able to implement the edit funcionality.
Now, we`ve been strugling to implement something like an 'add record' button where we would create a new row on the report with blank data that would let the user input the cell values, so when we call save() we can also get that new data that he inserted.
Hello, Jedison!
Thank you for your feedback.
We are happy to hear our example was helpful in implementing editing.
It is possible to add a new empty record by using updateData()
API call.
We have prepared an example for visualization: https://jsfiddle.net/flexmonster/wh12zdpj/.
In this example we used:
updateData()
to add an empty recordshowEmptyValues: true
option to show the empty row, as by default empty rows are hidden in Flexmonsterglobal.localization
to change the default label for an empty row from the (blank)
to -
for all the reportsYou are welcome to check the docs for more examples with updateData()
function: https://www.flexmonster.com/api/updatedata/#examples.
Hope it helps.
Kind regards,
Solomiia
Hello, Jedison!
Hope you are doing well.
Our team is wondering if you had some time to check the suggested approach to add a new editable line to the flat grid. Could you please let us know if it was helpful?
Looking forward to hearing your feedback.
Kind regards,
Solomiia
Hello, Solomiia.
Hope your're doing well.
your messages helped us so much while trying to validade with our users if flexmonster fits their needs.
With that being said, I also want to ask about copy paste features. Our users raised a point about not being able to copy some field from a spreadsheet and paste them on the grid with edit mode configuration enabled. Is there anthing you can provide us about that point?
EDIT: Using the information provided above about new records, I noticed that you use the propertie showEmptyValues inside grid:{}, but it looks like its not possible on angular, it is currently possible to use it inside the options:{} and we tried like that and i doesn`t seem to work.
{
dataSource: {
data: data,
},
options: {
grid: {
type: 'flat',
title: this.title,
showTotals: 'off',
showGrandTotals: 'off',
},
showEmptyData: true,
showEmptyValues: true,
editing: this.editable,
simplifyFieldListFolders: true,
showAllFieldsDrillThrough: false,
},
localization: '../../../../../assets/localization/localization-pt.json',
}
Kind regards,
Jedison
Hello, Jedison!
Thank you for getting back to us.
Kindly note that Flexmonster doesn't have extended editing functionality, as our component is mainly a tool to visualize data already present in the data source. So, it is not possible to paste entire row/rows from spreadsheets to Flexmonster grid, though it is possible to copy the selected area from Flexmonster and paste it to your spreadsheet.
As a possible workaround to transfer data from spreadsheets to Flexmonster, we suggest saving data from spreadsheets as a CSV file, and then importing it to Flexmonster using the Connect=>To local CSV Toolbar tab.
Regarding your question about showEmptyValues
, it's true that the following property should be set in the report.options. We have also double-checked the provided example and noticed that this property is not necessary for updateData()
to add a new empty row.
Hope you will find our answer helpful.
Kind regards,
Solomiia