problem of save automatically every change

long yu asked on April 8, 2019

Hi :
I would save the configuration automatically every change.
here is code :

r.on('reportchange', function(){
r.save({
destination: "server",
filename:"xxxx"
url: "xxxx.php"
});
});

but i found that it couldn't save the last action.





 

4 answers

Public
Vera Didenko Flexmonster April 8, 2019

Hello, 
 
Thank you for writing to us.

We have prepared a JSFiddle example for visualization.
Here the report is saved when a change is detected.

Please share with us which actions failed to save in your case.
This will help us understand what is causing the issue you have encountered.

Please note that it is possible that the problem may be in the server side script implementation.
 

We are looking forward to hearing from you.
 

Best Regards,
Vera

Public
long yu April 8, 2019

thanks a lot for your answer quickly !
but, there is a bug in it ! It don’t work !
Save a file first plz, then check the country column, and it will propose to download a file, then compare thees tow files, you will see that they are the same !
 
 
 

Public
Vera Didenko Flexmonster April 9, 2019

Hello, 
 

Thank you for your prompt reply.
 

You are right, the file downloaded is the same. 

The reason for this is that Flexmonster may have not rendered in time before the save action is performed.

To ensure that the pivot table is ready to be saved, the aftergriddraw API call is used:

flexmonster.on('reportchange', function () {
flexmonster.on('aftergriddraw', function () {
flexmonster.off('aftergriddraw');
save();
})
});

Please see the modified JSFiddle:http://jsfiddle.net/flexmonster/79q0ceta/

 
Please let us know if this works for you and if you have further questions.

 

Best Regards,
Vera

Public
long yu April 9, 2019

ok, thank you !

Please login or Register to Submit Answer