Localization and beforeRender problem



  • We get data with beforeRender from a webservice and save this to req.data:

    req.data = JSON.parse(response);
    

    But as soon as we manipulate req.data with beforeRender the localization doesn't work anymore. If we disable the script with beforeRender the localization works.

    Are the resources for localization stored in req.data and get overwritten with beforeRender?
    Or what else might cause this behaviour?



  • https://jsreport.net/learn/scripts

    Extend the req.data instead of overwriting it

    req.data = Object.assign({}, req.data, JSON.parse(response))
    


  • Perfect. Thx.


Log in to reply
 

Looks like your connection to jsreport forum was lost, please wait while we try to reconnect.