Runtime button onclick event handler function in Symfony/Encore/Webpack

I am newbie to web page development and I had to write web page using Symfony.

My issue is that I use free-jqgrid and I have a column containing buttons which are defined in cell formatter. So there is string, which is then inserted in the corresponding cell div.
I assign onClick function to the buttons and this function is not actually defined at main scope.
The only possible solution for me is to write it directly in twig page template.
When I try to define function in separate file and use encore_entry_script_tags to source that file, it is not defined at runtime when I press the button.

For me it seems not to be the "tidy" way. I would appreciate if anyone can advice or point me to the good source of information on this topic.

Thank you very much.

Source: Symfony Questions

Was this helpful?

0 / 0

Leave a Reply 0

Your email address will not be published. Required fields are marked *