How to pass variables in handlebars while calling function



  • Hi,

    i have a custom function 'getvaluefromkey', when i call this function as shown below it is working fine.
    var pe = {{{getvaluefromkey "ss" "p"}}};

    but if i pass the inputs as a variables it is not working, like below.
    var input1 = "ss";
    var input2 = "p";
    var pe = {{{getvaluefromkey input1 input2}}};

    please let us know how to pass the local variables in handlebars.



  • This won't work. Handlebars is unaware of the local js script evaluation.
    You need to do whatever calculation you do there inside the helper functions.



  • thank for the clarification


Log in to reply
 

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